diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2019-08-30 07:34:35 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2019-08-30 07:34:35 +0200 |
commit | 85216d3d95505c19a57d3bbe74e8a7eca109a8e6 (patch) | |
tree | 11be5cfbb3a1ab2854013be14f0728ea2d2a346a /sys/include | |
parent | 7bb1a9a18566ea9c8ae7f6c2fa99e448026521d2 (diff) |
auth/rsa2asn1: implement private key export with -a flag (thanks kvik)
kvik writes:
I needed to convert the RSA private key that was laying around in
secstore into a format understood by UNIX® tools like SSH.
With asn12rsa(8) we can go from the ASN.1/DER to Plan 9 format, but not
back - so I wrote the libsec function asn1encodeRSApriv(2) and used it in
rsa2asn1(8) by adding the -a flag which causes the full private key to be
encoded and output.
Diffstat (limited to 'sys/include')
-rw-r--r-- | sys/include/ape/libsec.h | 1 | ||||
-rw-r--r-- | sys/include/libsec.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/sys/include/ape/libsec.h b/sys/include/ape/libsec.h index 68783000e..ba339f1f9 100644 --- a/sys/include/ape/libsec.h +++ b/sys/include/ape/libsec.h @@ -380,6 +380,7 @@ void X509dump(uchar *cert, int ncert); mpint* pkcs1padbuf(uchar *buf, int len, mpint *modulus, int blocktype); int pkcs1unpadbuf(uchar *buf, int len, mpint *modulus, int blocktype); int asn1encodeRSApub(RSApub *pk, uchar *buf, int len); +int asn1encodeRSApriv(RSApriv *k, uchar *buf, int len); int asn1encodedigest(DigestState* (*fun)(uchar*, ulong, uchar*, DigestState*), uchar *digest, uchar *buf, int len); diff --git a/sys/include/libsec.h b/sys/include/libsec.h index de0717c00..fd063ebc0 100644 --- a/sys/include/libsec.h +++ b/sys/include/libsec.h @@ -372,6 +372,7 @@ void X509dump(uchar *cert, int ncert); mpint* pkcs1padbuf(uchar *buf, int len, mpint *modulus, int blocktype); int pkcs1unpadbuf(uchar *buf, int len, mpint *modulus, int blocktype); int asn1encodeRSApub(RSApub *pk, uchar *buf, int len); +int asn1encodeRSApriv(RSApriv *k, uchar *buf, int len); int asn1encodedigest(DigestState* (*fun)(uchar*, ulong, uchar*, DigestState*), uchar *digest, uchar *buf, int len); |