Class Index | File Index

Classes


Class KJUR.asn1.csr.CertificationRequest


Extends KJUR.asn1.ASN1Object.
ASN.1 CertificationRequest structure class
Defined in: asn1csr-1.0.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
ASN.1 CertificationRequest structure class
Fields borrowed from class KJUR.asn1.ASN1Object:
hL, hT, hTLV, hV, isModified
Method Summary
Method Attributes Method Name and Description
<static>  
KJUR.asn1.csr.CertificationRequest.getPEMString()
get PEM formatted certificate signing request (CSR/PKCS#10) This method is to a get CSR PEM string after signed.
<static>  
KJUR.asn1.csr.CertificationRequest.sign()
sign CertificationRequest and set signature value internally This method self-signs CertificateRequestInfo with a subject's private key and set signature value internally.
Class Detail
KJUR.asn1.csr.CertificationRequest(params)
ASN.1 CertificationRequest structure class
csri = new KJUR.asn1.csr.CertificationRequestInfo();
csri.setSubjectByParam({'str': '/C=US/O=Test/CN=example.com'});
csri.setSubjectPublicKeyByGetKey(pubKeyObj);
csr = new KJUR.asn1.csr.CertificationRequest({'csrinfo': csri});
csr.sign("SHA256withRSA", prvKeyObj);
pem = csr.getPEMString();

// -- DEFINITION OF ASN.1 SYNTAX --
// CertificationRequest ::= SEQUENCE {
//   certificationRequestInfo CertificationRequestInfo,
//   signatureAlgorithm       AlgorithmIdentifier{{ SignatureAlgorithms }},
//   signature                BIT STRING }
Parameters:
{Array} params
associative array of parameters (ex. {})
Since:
jsrsasign 4.8.7 asn1csr 1.0.0
Method Detail
<static> KJUR.asn1.csr.CertificationRequest.getPEMString()
get PEM formatted certificate signing request (CSR/PKCS#10) This method is to a get CSR PEM string after signed.
csr = new KJUR.asn1.csr.CertificationRequest({'csrinfo': csri});
csr.sign();
pem =  csr.getPEMString();
// pem will be following:
// -----BEGIN CERTIFICATE REQUEST-----
// MII ...snip...
// -----END CERTIFICATE REQUEST-----
Returns:
PEM formatted string of CSR/PKCS#10

<static> KJUR.asn1.csr.CertificationRequest.sign()
sign CertificationRequest and set signature value internally This method self-signs CertificateRequestInfo with a subject's private key and set signature value internally.
csr = new KJUR.asn1.csr.CertificationRequest({'csrinfo': csri});
csr.sign("SHA256withRSA", prvKeyObj);

© 2012-2015 Kenji Urushima, All rights reserved
Documentation generated by JsDoc Toolkit 2.4.0