Class Index | File Index

Classes


Class KJUR.asn1.x509.TBSCertificate


Extends KJUR.asn1.ASN1Object.
ASN.1 TBSCertificate structure class
Defined in: asn1x509-1.0.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
ASN.1 TBSCertificate structure class

EXAMPLE

Fields borrowed from class KJUR.asn1.ASN1Object:
hL, hT, hTLV, hV, isModified
Method Summary
Method Attributes Method Name and Description
 
append X.509v3 extension to this object
 
appendExtensionByName(name, extParams)
append X.509v3 extension to this object by name and parameters This method adds a X.509v3 extension specified by name and extParams to internal extension array of X.509v3 extension objects.
 
setIssuerByParam(x500NameParam)
set issuer name field by parameter
 
setNotAfterByParam(timeParam)
set notAfter field by parameter
 
set notBefore field by parameter
 
set serial number field by parameter
 
set signature algorithm field by parameter
 
setSubjectByParam(x500NameParam)
set subject name field by parameter
 
set subject public key info field by key object
<static>  
KJUR.asn1.x509.TBSCertificate.setSubjectPublicKeyByGetKey(keyParam)
set subject public key info by RSA/ECDSA/DSA key parameter
Methods borrowed from class KJUR.asn1.ASN1Object:
getEncodedHex, getLengthHexFromValue, getValueHex
Class Detail
KJUR.asn1.x509.TBSCertificate(params)
ASN.1 TBSCertificate structure class

EXAMPLE

 var o = new KJUR.asn1.x509.TBSCertificate();
 o.setSerialNumberByParam({'int': 4});
 o.setSignatureAlgByParam({'name': 'SHA1withRSA'});
 o.setIssuerByParam({'str': '/C=US/O=a'});
 o.setNotBeforeByParam({'str': '130504235959Z'});
 o.setNotAfterByParam({'str': '140504235959Z'});
 o.setSubjectByParam({'str': '/C=US/CN=b'});
 o.setSubjectPublicKey(rsaPubKey);
 o.appendExtension(new KJUR.asn1.x509.BasicConstraints({'cA':true}));
 o.appendExtension(new KJUR.asn1.x509.KeyUsage({'bin':'11'}));
Parameters:
{Array} params
associative array of parameters (ex. {})
Method Detail
appendExtension(extObj)
append X.509v3 extension to this object
tbsc.appendExtension(new KJUR.asn1.x509.BasicConstraints({'cA':true, 'critical': true}));
tbsc.appendExtension(new KJUR.asn1.x509.KeyUsage({'bin':'11'}));
Parameters:
{Extension} extObj
X.509v3 Extension object
See:
KJUR.asn1.x509.Extension

appendExtensionByName(name, extParams)
append X.509v3 extension to this object by name and parameters This method adds a X.509v3 extension specified by name and extParams to internal extension array of X.509v3 extension objects. Here is supported names of extension:
var o = new KJUR.asn1.x509.TBSCertificate();
o.appendExtensionByName('BasicConstraints', {'cA':true, 'critical': true});
o.appendExtensionByName('KeyUsage', {'bin':'11'});
o.appendExtensionByName('CRLDistributionPoints', {uri: 'http://aaa.com/a.crl'});
o.appendExtensionByName('ExtKeyUsage', {array: [{name: 'clientAuth'}]});
o.appendExtensionByName('AuthorityKeyIdentifier', {kid: '1234ab..'});
o.appendExtensionByName('AuthorityInfoAccess', {array: [{accessMethod:{oid:...},accessLocation:{uri:...}}]});
Parameters:
{name} name
name of X.509v3 Extension object
{Array} extParams
parameters as argument of Extension constructor.
See:
KJUR.asn1.x509.Extension

setIssuerByParam(x500NameParam)
set issuer name field by parameter
tbsc.setIssuerParam({'str': '/C=US/CN=b'});
Parameters:
{Array} x500NameParam
X500Name parameter
See:
KJUR.asn1.x509.X500Name

setNotAfterByParam(timeParam)
set notAfter field by parameter
tbsc.setNotAfterByParam({'str': '130508235959Z'});
Parameters:
{Array} timeParam
Time parameter
See:
KJUR.asn1.x509.Time

setNotBeforeByParam(timeParam)
set notBefore field by parameter
tbsc.setNotBeforeByParam({'str': '130508235959Z'});
Parameters:
{Array} timeParam
Time parameter
See:
KJUR.asn1.x509.Time

setSerialNumberByParam(intParam)
set serial number field by parameter
tbsc.setSerialNumberByParam({'int': 3});
Parameters:
{Array} intParam
DERInteger param

setSignatureAlgByParam(algIdParam)
set signature algorithm field by parameter
tbsc.setSignatureAlgByParam({'name': 'SHA1withRSA'});
Parameters:
{Array} algIdParam
AlgorithmIdentifier parameter

setSubjectByParam(x500NameParam)
set subject name field by parameter
tbsc.setSubjectParam({'str': '/C=US/CN=b'});
Parameters:
{Array} x500NameParam
X500Name parameter
See:
KJUR.asn1.x509.X500Name

setSubjectPublicKey(param)
set subject public key info field by key object
tbsc.setSubjectPublicKey(keyobj);
Parameters:
{Array} param
KJUR.asn1.x509.SubjectPublicKeyInfo class constructor parameter
See:
KJUR.asn1.x509.SubjectPublicKeyInfo

<static> KJUR.asn1.x509.TBSCertificate.setSubjectPublicKeyByGetKey(keyParam)
set subject public key info by RSA/ECDSA/DSA key parameter
tbsc.setSubjectPublicKeyByGetKeyParam(certPEMString); // or
tbsc.setSubjectPublicKeyByGetKeyParam(pkcs8PublicKeyPEMString); // or
tbsc.setSubjectPublicKeyByGetKeyParam(kjurCryptoECDSAKeyObject); // et.al.
Parameters:
{Object} keyParam
public key parameter which passed to KEYUTIL.getKey argument
Since:
asn1x509 1.0.6
See:
KJUR.asn1.x509.SubjectPublicKeyInfo
KEYUTIL.getKey

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