Class Index | File Index

Classes


Class KJUR.asn1.cms.SignerInfo


Extends KJUR.asn1.ASN1Object.
class for Attributes ASN.1 structure of CMS SigndData
Defined in: asn1cms-1.0.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
class for SignerInfo ASN.1 structure of CMS SignedData
This class is an ASN.1 encoder for SignerInfo structure defined in RFC 5652 CMS section 5.3.
Fields borrowed from class KJUR.asn1.ASN1Object:
hL, hT, hTLV, hV, isModified, params
Method Summary
Method Attributes Method Name and Description
 
sign()
sign SignerInfo
This method signs SignerInfo with a specified private key and algorithm by "params.signkey" and "params.sigalg" parameter.
Methods borrowed from class KJUR.asn1.ASN1Object:
getEncodedHex, getLengthHexFromValue, getValueHex, tohex
Class Detail
KJUR.asn1.cms.SignerInfo(params)
class for SignerInfo ASN.1 structure of CMS SignedData
This class is an ASN.1 encoder for SignerInfo structure defined in RFC 5652 CMS section 5.3.
SignerInfo ::= SEQUENCE {
   version CMSVersion,
   sid SignerIdentifier,
   digestAlgorithm DigestAlgorithmIdentifier,
   signedAttrs [0] IMPLICIT SignedAttributes OPTIONAL,
   signatureAlgorithm SignatureAlgorithmIdentifier,
   signature SignatureValue,
   unsignedAttrs [1] IMPLICIT UnsignedAttributes OPTIONAL }
Constractor parameter can have following properties:
  • {Integer}version - version of SignerInfo.
  • {Array}id - KJUR.asn1.cms.SignerIdentifier parameter for sid
  • {String}hashalg - digestAlgorithm name string (ex. "sha256")
  • {Array}sattrs - KJUR.asn1.cms.AttributeList parameter for signedAttributes
  • {String}sigalg - string for signatureAlgorithm name
  • {String}signkey (OPTION) - specifies signing private key. Parameter "signkey" or "sighex" shall be specified. Following values can be specified:
    • PKCS#1/5 or PKCS#8 PEM string of private key
    • RSAKey/DSA/ECDSA key object. KEYUTIL.getKey is useful to generate a key object.
  • {String}sighex (OPTION) - hexadecimal string of signature value (i.e. ASN.1 value(V) of signatureValue BIT STRING without unused bits)
new KJUR.asn1.cms.SignerInfo({
  version: 1,
  id: {type: 'isssn', issuer: {str: '/C=US/O=T1'}, serial: {int: 1}},
  hashalg: "sha1",
  sattrs: {array: [{
    attr: "contentType",
    type: '1.2.840.113549.1.7.1'
  },{
    attr: "messageDigest",
    hex: 'a1a2a3a4a5a6a7a8a9a0a1a2a3a4a5a6a7a8a9a0'
  }]},
  sigalg: "SHA1withRSA",
  sighex: 'b1b2b...'
})
Parameters:
{Array} params
associative array of parameters
Since:
jsrsasign 4.2.4 asn1cms 1.0.0
See:
KJUR.asn1.cms.SignerIdentifier
KJUR.asn1.x509.AlgorithmIdentifier
KJUR.asn1.cms.AttributeList
Method Detail
sign()
sign SignerInfo
This method signs SignerInfo with a specified private key and algorithm by "params.signkey" and "params.sigalg" parameter. In general, you don't need to call this method. It will be called when tohex() method if necessary.
si = new KJUR.asn1.cms.SignerInfo({...});
si.sign()

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