Class KJUR.asn1.x509.X509Util
X.509 certificate and CRL utilities class
Defined in: asn1x509-1.0.js.
Constructor Attributes | Constructor Name and Description |
---|---|
X.509 certificate and CRL utilities class
|
Method Attributes | Method Name and Description |
---|---|
<static> |
KJUR.asn1.x509.X509Util.newCertPEM(param)
issue a certificate in PEM format (DEPRECATED)
This method can issue a certificate by a simple
JSON object.
|
Method Detail
<static>
KJUR.asn1.x509.X509Util.newCertPEM(param)
issue a certificate in PEM format (DEPRECATED)
This method can issue a certificate by a simple
JSON object.
Signature value will be provided by signing with
private key using 'cakey' parameter or
hexadecimal signature value by 'sighex' parameter.
NOTE: Algorithm parameter of AlgorithmIdentifier will be set automatically by default. (see KJUR.asn1.x509.AlgorithmIdentifier) from jsrsasign 7.1.1 asn1x509 1.0.20.
NOTE2: RSA-PSS algorithm has been supported from jsrsasign 8.0.21. As for RSA-PSS signature algorithm names and signing parameters such as MGF function and salt length, please see KJUR.asn1.x509.AlgorithmIdentifier class.
NOTE: Algorithm parameter of AlgorithmIdentifier will be set automatically by default. (see KJUR.asn1.x509.AlgorithmIdentifier) from jsrsasign 7.1.1 asn1x509 1.0.20.
NOTE2: RSA-PSS algorithm has been supported from jsrsasign 8.0.21. As for RSA-PSS signature algorithm names and signing parameters such as MGF function and salt length, please see KJUR.asn1.x509.AlgorithmIdentifier class.
var certPEM = KJUR.asn1.x509.X509Util.newCertPEM({ serial: {int: 4}, sigalg: {name: 'SHA1withECDSA'}, issuer: {str: '/C=US/O=a'}, notbefore: {'str': '130504235959Z'}, notafter: {'str': '140504235959Z'}, subject: {str: '/C=US/O=b'}, sbjpubkey: pubKeyObj, ext: [ {basicConstraints: {cA: true, critical: true}}, {keyUsage: {bin: '11'}}, ], cakey: prvKeyObj }); // -- or -- var certPEM = KJUR.asn1.x509.X509Util.newCertPEM({ serial: {int: 4}, sigalg: {name: 'SHA1withECDSA'}, issuer: {str: '/C=US/O=a'}, notbefore: {'str': '130504235959Z'}, notafter: {'str': '140504235959Z'}, subject: {str: '/C=US/O=b'}, sbjpubkey: pubKeyPEM, ext: [ {basicConstraints: {cA: true, critical: true}}, {keyUsage: {bin: '11'}}, ], cakey: [prvkey, pass]} ); // -- or -- var certPEM = KJUR.asn1.x509.X509Util.newCertPEM({ serial: {int: 1}, sigalg: {name: 'SHA1withRSA'}, issuer: {str: '/C=US/O=T1'}, notbefore: {'str': '130504235959Z'}, notafter: {'str': '140504235959Z'}, subject: {str: '/C=US/O=T1'}, sbjpubkey: pubKeyObj, sighex: '0102030405..' }); // for the issuer and subject field, another // representation is also available var certPEM = KJUR.asn1.x509.X509Util.newCertPEM({ serial: {int: 1}, sigalg: {name: 'SHA256withRSA'}, issuer: {C: "US", O: "T1"}, notbefore: {'str': '130504235959Z'}, notafter: {'str': '140504235959Z'}, subject: {C: "US", O: "T1", CN: "http://example.com/"}, sbjpubkey: pubKeyObj, sighex: '0102030405..' });
- Parameters:
- {Array} param
- JSON object of parameter to issue a certificate
- Deprecated:
- since jsrsasign 9.0.0 asn1x509 2.0.0. please move to KJUR.asn1.x509.Certificate constructor
- Since:
- asn1x509 1.0.6