From a6fde3edc5ec390d23e50110c93492d42f1e23e1 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Fri, 30 Aug 2019 07:35:54 +0200 Subject: rsa(2): document asn1encodeRSApriv() and asn1encodeRSApub() functions --- sys/man/2/rsa | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/sys/man/2/rsa b/sys/man/2/rsa index 59606e923..627991e18 100644 --- a/sys/man/2/rsa +++ b/sys/man/2/rsa @@ -2,6 +2,8 @@ .SH NAME asn1dump, asn1toRSApriv, +asn1encodeRSApriv, +asn1encodeRSApub, decodePEM, rsadecrypt, rsaencrypt, @@ -62,7 +64,13 @@ RSApub* X509toRSApub(uchar *cert, int ncert, char *name, int nname) RSApriv* asn1toRSApriv(uchar *priv, int npriv) .PP .B -void asn1dump(uchar *der, int len) +int asn1encodeRSApriv(RSApriv *k, uchar *buf, int len) +.PP +.B +int asn1encodeRSApub(RSApub *pk, uchar *buf, int len) +.PP +.B +void asn1dump(uchar *der, int len) .PP .B uchar* decodePEM(char *s, char *type, int *len, char **new_s) @@ -207,6 +215,21 @@ converts an ASN1 formatted RSA private key into the corresponding .B RSApriv structure. .PP +.I Asn1encodeRSApriv +and +.I asn1encodeRSApub +export a +.B RSApriv +or +.B RSApub +structure to ASN1 format. +On success, +.I buf +is filled and the encoded byte length is returned. +Otherwise +.B -1 +is returned and error string is set. +.PP .I Asn1dump prints an ASN1 object to standard output. .PP -- cgit v1.2.3