public final class CMSAuthenticatedEnvelopedData
extends java.lang.Object
id-ct-authEnvelopedData OBJECT IDENTIFIER ::= { iso(1)
member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9)
smime(16) ct(1) 23 }
The authenticated-data content type shall have ASN.1 type
AuthenticatedEnvelopedData:
AuthEnvelopedData ::= SEQUENCE {
version CMSVersion,
originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
recipientInfos RecipientInfos,
authEncryptedContentInfo EncryptedContentInfo,
authAttrs [1] IMPLICIT AuthAttributes OPTIONAL,
mac MessageAuthenticationCode,
unauthAttrs [2] IMPLICIT UnauthAttributes OPTIONAL }
AuthAttributes ::= SET SIZE (1..MAX) OF Attribute
UnauthAttributes ::= SET SIZE (1..MAX) OF Attribute
MessageAuthenticationCode ::= OCTET STRING
La implementación del código ha seguido los pasos necesarios
para crear un mensaje AuthenticatedEnvelopedData de BouncyCastle: www.bouncycastle.orgModifier and Type | Method and Description |
---|---|
static byte[] |
addOriginatorInfo(byte[] data,
java.security.cert.X509Certificate[] signerCertificateChain)
Método que inserta remitentes en el "OriginatorInfo" de un sobre
de tipo AuthenticatedEnvelopedData.
|
public static byte[] addOriginatorInfo(byte[] data, java.security.cert.X509Certificate[] signerCertificateChain) throws java.io.IOException, java.security.cert.CertificateEncodingException
data
- Datos CMS de tipo AuthenticatedEnvelopedData.signerCertificateChain
- Cadena de certificados a agregar.java.io.IOException
- Cuando hay errores de lectura o escritura de datosjava.security.cert.CertificateEncodingException
- Si hay algún certificado inválido en la cadena