Class KJUR.asn1.cms.SignerInfo
Extends
KJUR.asn1.ASN1Object.
class for Attributes ASN.1 structure of CMS SigndData
Defined in: asn1cms-1.0.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
KJUR.asn1.cms.SignerInfo(params)
class for SignerInfo ASN.1 structure of CMS SignedData
SignerInfo ::= SEQUENCE {
version CMSVersion,
sid SignerIdentifier,
digestAlgorithm DigestAlgorithmIdentifier,
signedAttrs [0] IMPLICIT SignedAttributes OPTIONAL,
signatureAlgorithm SignatureAlgorithmIdentifier,
signature SignatureValue,
unsignedAttrs [1] IMPLICIT UnsignedAttributes OPTIONAL }
|
| Field Attributes | Field Name and Description |
|---|---|
| <static> |
KJUR.asn1.cms.SignerInfo.setForContentAndHash
set ContentType/MessageDigest/DigestAlgorithms for SignerInfo/SignedData
This method will specify following fields by a parameters:
|
- Fields borrowed from class KJUR.asn1.ASN1Object:
- hL, hT, hTLV, hV, isModified
- Methods borrowed from class KJUR.asn1.ASN1Object:
- getEncodedHex, getLengthHexFromValue, getValueHex
Class Detail
KJUR.asn1.cms.SignerInfo(params)
class for SignerInfo ASN.1 structure of CMS SignedData
SignerInfo ::= SEQUENCE {
version CMSVersion,
sid SignerIdentifier,
digestAlgorithm DigestAlgorithmIdentifier,
signedAttrs [0] IMPLICIT SignedAttributes OPTIONAL,
signatureAlgorithm SignatureAlgorithmIdentifier,
signature SignatureValue,
unsignedAttrs [1] IMPLICIT UnsignedAttributes OPTIONAL }
o = new KJUR.asn1.cms.SignerInfo();
o.setSignerIdentifier(certPEMstring);
o.dSignedAttrs.add(new KJUR.asn1.cms.ContentType({name: 'data'}));
o.dSignedAttrs.add(new KJUR.asn1.cms.MessageDigest({hex: 'a1b2...'}));
o.dSignedAttrs.add(new KJUR.asn1.cms.SigningTime());
o.sign(privteKeyParam, "SHA1withRSA");
- Parameters:
- {Array} params
- associative array of parameters
- Since:
- jsrsasign 4.2.4 asn1cms 1.0.0
Field Detail
<static>
KJUR.asn1.cms.SignerInfo.setForContentAndHash
set ContentType/MessageDigest/DigestAlgorithms for SignerInfo/SignedData
This method will specify following fields by a parameters:
- add ContentType signed attribute by encapContentInfo
- add MessageDigest signed attribute by encapContentInfo and hashAlg
- add a hash algorithm used in MessageDigest to digestAlgorithms field of SignedData
- set a hash algorithm used in MessageDigest to digestAlgorithm field of SignerInfo
- eciObj - KJUR.asn1.cms.EncapsulatedContentInfo object
- sdObj - KJUR.asn1.cms.SignedData object (Option) to set DigestAlgorithms
- hashAlg - string of hash algorithm name which is used for MessageDigest attribute
sd = new KJUR.asn1.cms.SignedData();
signerInfo.setForContentAndHash({sdObj: sd,
eciObj: sd.dEncapContentInfo,
hashAlg: 'sha256'});