public interface AOEnveloper
Modifier and Type | Method and Description |
---|---|
byte[] |
encrypt(byte[] data,
java.lang.String digestAlgorithm,
java.lang.String key,
CipherConstants.AOCipherAlgorithm cipherAlgorithm,
java.lang.String dataType)
Cifra un contenido.
|
byte[] |
envelop(byte[] data,
java.lang.String digestAlgorithm,
java.lang.String type,
java.security.KeyStore.PrivateKeyEntry keyEntry,
java.security.cert.X509Certificate[] certDest,
CipherConstants.AOCipherAlgorithm cipherAlgorithm,
java.lang.String dataType,
java.util.Properties extraParams)
Contruye distintas estructuras PKCS#7.
|
byte[] |
recoverData(byte[] envelop,
java.security.KeyStore.PrivateKeyEntry addresseePke)
Recupera los datos contenidos en un envoltorio.
|
byte[] envelop(byte[] data, java.lang.String digestAlgorithm, java.lang.String type, java.security.KeyStore.PrivateKeyEntry keyEntry, java.security.cert.X509Certificate[] certDest, CipherConstants.AOCipherAlgorithm cipherAlgorithm, java.lang.String dataType, java.util.Properties extraParams) throws AOException
data
- Datos que se van a envolver.digestAlgorithm
- Algoritmo a usar para la firma y huella digital (SHA1withRSA, MD5withRSA,...)type
- Tipo de estructura que se quiere construirkeyEntry
- Clave privada a usar para firmar.certDest
- Certificados de los usuarios a los que va destinado el sobre
digital.cipherAlgorithm
- Algoritmo a usar para el cifradodataType
- OID del tipo de datos a encriptarextraParams
- Parámetros adicionalesAOException
- Cuando ocurre cualquier problema en el proceso.byte[] encrypt(byte[] data, java.lang.String digestAlgorithm, java.lang.String key, CipherConstants.AOCipherAlgorithm cipherAlgorithm, java.lang.String dataType) throws AOException
data
- Datos que se van a encriptar.digestAlgorithm
- Algoritmo a usar para la firma y la huella digital (SHA1withRSA, MD5withRSA,...)key
- Clave codificada o contraseña usada
para cifrar el contenido.cipherAlgorithm
- Algoritmo a usar para el cifradodataType
- OID del tipo de datos a encriptarAOException
- Cuando ocurre cualquier problema durante el procesobyte[] recoverData(byte[] envelop, java.security.KeyStore.PrivateKeyEntry addresseePke) throws java.security.InvalidKeyException, AOException, java.io.IOException, java.security.spec.InvalidKeySpecException
envelop
- Envoltorio de datos.addresseePke
- Clave privada del receptor del envoltorio (si es necesario)java.security.InvalidKeyException
- Si la clave indicada no es válida o no pertenece a un destinatario del envoltorio.AOException
- Cuando ocurre algun problema en la apetura del envoltorio.java.io.IOException
- Si hay problema de lectura / escritura de datosjava.security.spec.InvalidKeySpecException
- Cuando la clave es inválida