Class Index | File Index

Classes


Class KJUR.asn1.x509.AlgorithmIdentifier


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

Class Summary
Constructor Attributes Constructor Name and Description
 
AlgorithmIdentifier ASN.1 structure class The 'params' argument is an associative array and has following parameters:
  • name: algorithm name (MANDATORY, ex.
Field Summary
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:
  • 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)
RSA-PSS algorithm names such as SHA{,256,384,512}withRSAandMGF1 are special names. They will set a suite of algorithm OID and multiple algorithm parameters. Its ASN.1 schema is defined in RFC 3447 PKCS#1 2.1 section A.2.3.
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:
Namealg oidpss hashmaskgenpss saltlentrailer
SHAwithRSAandMGF11.2.840.113549.1.1.10(rsapss)default(sha1)default(mgf1sha1)default(20)default(1)
SHA256withRSAandMGF11.2.840.113549.1.1.10(rsapss)sha256mgf1sha25632default(1)
SHA384withRSAandMGF11.2.840.113549.1.1.10(rsapss)sha384mgf1sha38448default(1)
SHA512withRSAandMGF11.2.840.113549.1.1.10(rsapss)sha512mgf1sha51264default(1)
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.
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

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