Class Index | File Index

Classes


Class KJUR.asn1.cms.SignedData


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
ContentInfo ::= SEQUENCE {
   contentType ContentType,
   content [0] EXPLICIT ANY DEFINED BY contentType }
ContentType ::= OBJECT IDENTIFIER
SignedData ::= SEQUENCE {
   version CMSVersion,
   digestAlgorithms DigestAlgorithmIdentifiers,
   encapContentInfo EncapsulatedContentInfo,
   certificates [0] IMPLICIT CertificateSet OPTIONAL,
   crls [1] IMPLICIT RevocationInfoChoices OPTIONAL,
   signerInfos SignerInfos }
SignerInfos ::= SET OF SignerInfo
CertificateSet ::= SET OF CertificateChoices
DigestAlgorithmIdentifiers ::= SET OF DigestAlgorithmIdentifier
CertificateSet ::= SET OF CertificateChoices
RevocationInfoChoices ::= SET OF RevocationInfoChoice
Fields borrowed from class KJUR.asn1.ASN1Object:
hL, hT, hTLV, hV, isModified, params
Method Summary
Method Attributes Method Name and Description
 
fix fields before ASN.1 encode
Update following values of "params" property as defined in RFC 5652:
  • set "digestAlgorithms" field of "signedData" by signerInfos
  • set all "contentType" signed attribute value to the same value of eContent
  • set all "messageDigest" signed attribute value to hash value of eContent contents value
  • all signerInfo version by their fields
  • signedData version by their fields
In general, you don't need to call this method.
 
get CotentInfo ASN.1 object concluding CMS SignedData
This method returns a KJUR.asn1.ASN1Object of ContentInfo concludes SignedData.
 
get hex of entire ContentInfo of CMS SignedData
This method returns a hexadecimal string of ContentInfo concludes SignedData.
Methods borrowed from class KJUR.asn1.ASN1Object:
getEncodedHex, getLengthHexFromValue, getValueHex, tohex
Class Detail
KJUR.asn1.cms.SignedData(params)
class for SignerInfo ASN.1 structure of CMS SignedData
ContentInfo ::= SEQUENCE {
   contentType ContentType,
   content [0] EXPLICIT ANY DEFINED BY contentType }
ContentType ::= OBJECT IDENTIFIER
SignedData ::= SEQUENCE {
   version CMSVersion,
   digestAlgorithms DigestAlgorithmIdentifiers,
   encapContentInfo EncapsulatedContentInfo,
   certificates [0] IMPLICIT CertificateSet OPTIONAL,
   crls [1] IMPLICIT RevocationInfoChoices OPTIONAL,
   signerInfos SignerInfos }
SignerInfos ::= SET OF SignerInfo
CertificateSet ::= SET OF CertificateChoices
DigestAlgorithmIdentifiers ::= SET OF DigestAlgorithmIdentifier
CertificateSet ::= SET OF CertificateChoices
RevocationInfoChoices ::= SET OF RevocationInfoChoice
sd = new KJUR.asn1.cms.SignedData({
  version: 1,
  hashalgs: ["sha1"],
  econtent: {
    type: "data",
    content: {
      hex: "616161"
    }
  },
  certs: [PEM1,...],
  revinfos: {array: [...]},
  sinfos: [{
    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: 'abcd'
    }]},
    sigalg: "SHA1withRSA",
    signkey: PEMPRIVATEKEY
  }]
});
hex = sd.getContentInfoEncodedHex();
Parameters:
{Array} params
associative array of parameters
Since:
jsrsasign 4.2.4 asn1cms 1.0.0
Method Detail
checkAndFixParam()
fix fields before ASN.1 encode
Update following values of "params" property as defined in RFC 5652: In general, you don't need to call this method. It will be called automatically when getEncodedHex() method is called.
NOTE: If you don't want to do such property value update, set "params.fixed" property to "true".

{Object} getContentInfo()
get CotentInfo ASN.1 object concluding CMS SignedData
This method returns a KJUR.asn1.ASN1Object of ContentInfo concludes SignedData.
sd = new KJUR.asn1.cms.SignedData({...});
sd.getContentInfo();
Returns:
{Object} ContentInfo of SigneData as KJUR.asn1.ASN1Object
See:
KJUR.asn1.cms.ContentInfo

{String} getContentInfoEncodedHex()
get hex of entire ContentInfo of CMS SignedData
This method returns a hexadecimal string of ContentInfo concludes SignedData.
sd = new KJUR.asn1.cms.SignedData({...});
sd.getContentInfoEncodedHex() &rarr "3082..."
Returns:
{String} hexadecimal string of entire ContentInfo of CMS SignedData
See:
KJUR.asn1.cms.SignedData#getContentInfo
KJUR.asn1.cms.ContentInfo

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