|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--PKCS10Generator
Class implementing a PKCS#10 certificate request
Defined in pkcs10.js
Field Summary | |
Object |
crypto
|
<static> Object |
cRLSign
|
<static> Object |
dataEncipherment
|
<static> Object |
decipherOnly
|
<static> Object |
digitalSignature
|
<static> Object |
encipherOnly
|
<static> Object |
keyAgreement
|
<static> Object |
keyCertSign
|
<static> Object |
keyEncipherment
|
<static> Object |
nonRepudiation
|
Constructor Summary | |
PKCS10Generator(<Crypto> crypto)
Create a PKCS#10 certificate request |
Method Summary | |
void
|
addBasicConstraintsExtension(<Boolean> cA, <Number> pathLenConstraint)
Adds the BasicConstraints extension. |
void
|
addExtendedKeyUsageExtension(keyusages)
Adds extended key usages |
void
|
addExtension(<String> extnID, extnValue)
Adds an extension to the certificate |
void
|
addKeyUsageExtension(flags)
Adds the key usage extension. |
ASN1
|
generateCertificationRequest(privateKey)
Generates the certificate. |
ASN1
|
getAttributes()
Gets the attributes as TLV object |
ASN1
|
getExtensions()
Gets the extension attribute as TLV object |
ASN1
|
getSignatureAlgorithm()
Gets the signature algorithm TLV object |
ASN1
|
getSubject()
Gets the subject name as TLV object |
ASN1
|
getSubjectPublicKeyInfo()
Gets the subject's public key as TLV object |
ASN1
|
getTbsRequest()
Gets the part of the request that will be signed |
void
|
reset()
Resets all internal state variables. |
void
|
setPublicKey(<Key> publicKey)
Sets the subjects public key |
void
|
setSignatureAlgorithm(<Number> alg)
Sets the signature algorithm. |
void
|
setSubject(<Object> subject)
Sets the subject name. |
Field Detail |
Object crypto
<static> Object cRLSign
<static> Object dataEncipherment
<static> Object decipherOnly
<static> Object digitalSignature
<static> Object encipherOnly
<static> Object keyAgreement
<static> Object keyCertSign
<static> Object keyEncipherment
<static> Object nonRepudiation
Constructor Detail |
PKCS10Generator(<Crypto> crypto)
crypto
- the crypto provider to use for signing operations
Method Detail |
void addBasicConstraintsExtension(<Boolean> cA, <Number> pathLenConstraint)
cA
- the certificate belongs to a CA
pathLenConstraint
- the maximum number of subordinate CA certificates
void addExtendedKeyUsageExtension(keyusages)
the
- list of extended key usage object identifier
void addExtension(<String> extnID, extnValue)
The structure is defined as:
Extension ::= SEQUENCE { extnID OBJECT IDENTIFIER, extnValue OCTET STRING -- contains the DER encoding of an ASN.1 value -- corresponding to the extension type identified -- by extnID }
extnID
- the extensions object identifier
the
- extension value as ByteString
void addKeyUsageExtension(flags)
The following flags are defined:
PKCS10Generator.digitalSignature = 0x0080; PKCS10Generator.nonRepudiation = 0x0040; PKCS10Generator.keyEncipherment = 0x0020; PKCS10Generator.dataEncipherment = 0x0010; PKCS10Generator.keyAgreement = 0x0008; PKCS10Generator.keyCertSign = 0x0004; PKCS10Generator.cRLSign = 0x0002; PKCS10Generator.encipherOnly = 0x0001; PKCS10Generator.decipherOnly = 0x8000;
the
- key usage flags as combination of the flags defined above.
ASN1 generateCertificationRequest(privateKey)
ASN1 getAttributes()
ASN1 getExtensions()
ASN1 getSignatureAlgorithm()
ASN1 getSubject()
ASN1 getSubjectPublicKeyInfo()
ASN1 getTbsRequest()
void reset()
void setPublicKey(<Key> publicKey)
The methods accepts ECC and RSA Public Keys.
publicKey
- the subjects public key
void setSignatureAlgorithm(<Number> alg)
alg
- the signature algorithm, only Crypto.RSA supported
void setSubject(<Object> subject)
The subject name must be a JavaScript object containing the properties:
Example:
var subject = { C:"UT", O:"ACME Corporation", CN:"Joe Doe" };
subject
- the subject name
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |