Class KJUR.asn1.cms.CMSUtil
CMS utilities class
Defined in: asn1cms-1.0.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
CMS utiliteis class
|
| Method Attributes | Method Name and Description |
|---|---|
| <static> |
KJUR.asn1.cms.CMSUtil.newSignedData(param)
generate SignedData object specified by JSON parameters
This method provides more easy way to genereate
CMS SignedData ASN.1 structure by JSON data.
|
| <static> |
KJUR.asn1.cms.CMSUtil.verifySignedData(param)
verify SignedData specified by JSON parameters
This method provides validation for CMS SignedData.
|
Method Detail
<static>
{KJUR.asn1.cms.SignedData}
KJUR.asn1.cms.CMSUtil.newSignedData(param)
generate SignedData object specified by JSON parameters
This method provides more easy way to genereate
CMS SignedData ASN.1 structure by JSON data.
Here is major parameters:
Here is major parameters:
- content - to specify data to be signed in eContent field.
- certs - a list of certificate PEM strings to specify certificate field
- detached - 'true' or 'false' to specify detached signature or not. The default is 'false'
- signerInfos - array of signerInfo parameters.
SignerInfo parameters listed here:
- hashAlg - string of messageDigest hash algorithm name
- sAttr - list of signedAttribute parameters
- signerCert - string of signer certificate PEM
- sigAlg - string of signature algorithm name
- signerPrvKey - string of PEM signer private key
var sd = KJUR.asn1.cms.CMSUtil.newSignedData({
content: {str: "jsrsasign"},
certs: [certPEM],
detached: false,
signerInfos: [{
hashAlg: 'sha256',
sAttr: {
SigningTime: {}
SigningCertificateV2: {array: [certPEM]},
},
signerCert: certPEM,
sigAlg: 'SHA256withRSA',
signerPrvKey: prvPEM
}]
});
- Parameters:
- {Array} param
- JSON parameter to generate CMS SignedData
- Returns:
- {KJUR.asn1.cms.SignedData} object just generated
<static>
{Object}
KJUR.asn1.cms.CMSUtil.verifySignedData(param)
verify SignedData specified by JSON parameters
This method provides validation for CMS SignedData.
Following parameters can be applied:
- cms - hexadecimal data of DER CMS SignedData (aka. PKCS#7 or p7s) to verify (OPTION)
KJUR.asn1.cms.CMSUtil.verifySignedData({ cms: "3082058a..." })
→
{
isValid: true,
parse: ... // parsed data
signerInfos: [
{
}
]
}
- Parameters:
- {Array} param
- JSON parameter to verify CMS SignedData
- Since:
- jsrsasign 8.0.4 asn1cms 1.0.5
- Returns:
- {Object} JSON data as the result of validation