git: 9front

Download patch

ref: 26d7e6a759780a68f3993cd6497ea7f5b2e75b96
parent: e42691d98d854a3f14c0a18e3bfc714746eb693a
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri Aug 30 03:35:54 EDT 2019

rsa(2): document asn1encodeRSApriv() and asn1encodeRSApub() functions

--- a/sys/man/2/rsa
+++ b/sys/man/2/rsa
@@ -2,6 +2,8 @@
 .SH NAME
 asn1dump,
 asn1toRSApriv,
+asn1encodeRSApriv,
+asn1encodeRSApub,
 decodePEM,
 rsadecrypt,
 rsaencrypt,
@@ -62,9 +64,15 @@
 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)
 .PP
 .B
@@ -206,6 +214,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.
--