Class KJUR.asn1.x509.AlgorithmIdentifier
Extends
KJUR.asn1.ASN1Object.
AlgorithmIdentifier ASN.1 structure class
Defined in: asn1x509-1.0.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
AlgorithmIdentifier ASN.1 structure class
The 'params' argument is an associative array and has following parameters:
|
| Field Attributes | Field Name and Description |
|---|---|
| <static> |
KJUR.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV
AlgorithmIdentifier ASN.1 TLV string associative array for RSA-PSS algorithm names
|
- Fields borrowed from class KJUR.asn1.ASN1Object:
- hL, hT, hTLV, hV, isModified, params
- Methods borrowed from class KJUR.asn1.ASN1Object:
- getEncodedHex, getLengthHexFromValue, getValueHex, tohex
Class Detail
KJUR.asn1.x509.AlgorithmIdentifier(params)
AlgorithmIdentifier ASN.1 structure class
The 'params' argument is an associative array and has following parameters:
Default value is omitted as defined in ASN.1 schema.
These parameters are interoperable to OpenSSL or IAIK toolkit.
NOTE: RSA-PSS algorihtm names are supported since jsrsasign 8.0.21.
- name: algorithm name (MANDATORY, ex. sha1, SHA256withRSA)
- asn1params: explicitly specify ASN.1 object for algorithm. (OPTION)
- paramempty: set algorithm parameter to NULL by force. If paramempty is false, algorithm parameter will be set automatically. If paramempty is false and algorithm name is "*withDSA" or "withECDSA" parameter field of AlgorithmIdentifier will be ommitted otherwise it will be NULL by default. (OPTION, DEFAULT = false)
id-RSASSA-PSS OBJECT IDENTIFIER ::= { pkcs-1 10 }
RSASSA-PSS-params ::= SEQUENCE {
hashAlgorithm [0] HashAlgorithm DEFAULT sha1,
maskGenAlgorithm [1] MaskGenAlgorithm DEFAULT mgf1SHA1,
saltLength [2] INTEGER DEFAULT 20,
trailerField [3] TrailerField DEFAULT trailerFieldBC }
mgf1SHA1 MaskGenAlgorithm ::= {
algorithm id-mgf1,
parameters HashAlgorithm : sha1 }
id-mgf1 OBJECT IDENTIFIER ::= { pkcs-1 8 }
TrailerField ::= INTEGER { trailerFieldBC(1) }
Here is a table for PSS parameters:
| Name | alg oid | pss hash | maskgen | pss saltlen | trailer |
|---|---|---|---|---|---|
| SHAwithRSAandMGF1 | 1.2.840.113549.1.1.10(rsapss) | default(sha1) | default(mgf1sha1) | default(20) | default(1) |
| SHA256withRSAandMGF1 | 1.2.840.113549.1.1.10(rsapss) | sha256 | mgf1sha256 | 32 | default(1) |
| SHA384withRSAandMGF1 | 1.2.840.113549.1.1.10(rsapss) | sha384 | mgf1sha384 | 48 | default(1) |
| SHA512withRSAandMGF1 | 1.2.840.113549.1.1.10(rsapss) | sha512 | mgf1sha512 | 64 | default(1) |
NOTE: RSA-PSS algorihtm names are supported since jsrsasign 8.0.21.
new KJUR.asn1.x509.AlgorithmIdentifier({name: "sha1"})
new KJUR.asn1.x509.AlgorithmIdentifier({name: "SHA256withRSA"})
new KJUR.asn1.x509.AlgorithmIdentifier({name: "SHA512withRSAandMGF1"}) // set parameters automatically
new KJUR.asn1.x509.AlgorithmIdentifier({name: "SHA256withRSA", paramempty: true})
new KJUR.asn1.x509.AlgorithmIdentifier({name: "rsaEncryption"})
- Parameters:
- {Array} params
- associative array of parameters (ex. {'name': 'SHA1withRSA'})
Field Detail
<static>
KJUR.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV
AlgorithmIdentifier ASN.1 TLV string associative array for RSA-PSS algorithm names