public final class JseCryptoHelper extends java.lang.Object implements CryptoHelper
CryptoHelper.ALGORITHM
Constructor and Description |
---|
JseCryptoHelper() |
Modifier and Type | Method and Description |
---|---|
byte[] |
digest(CryptoHelper.ALGORITHM algorithm,
byte[] data)
Realiza una huella digital de los datos proporcionados.
|
java.security.cert.X509Certificate |
generateCertificate(byte[] encode)
Genera un certificado del tipo indicado a partir de su
codificación.
|
byte[] |
generateRandomBytes(int numBytes)
Genera un aleatorio contenido en un array de bytes.
|
byte[] |
rsaDecrypt(byte[] cipheredData,
java.security.interfaces.RSAKey key)
Desencripta datos mediante RSA.
|
byte[] |
rsaEncrypt(byte[] data,
java.security.interfaces.RSAKey key)
Encripta datos mediante RSA.
|
public byte[] digest(CryptoHelper.ALGORITHM algorithm, byte[] data)
digest
in interface CryptoHelper
algorithm
- Algoritmo de huella digital que debe utilizarsedata
- Datos de entradapublic byte[] rsaDecrypt(byte[] cipheredData, java.security.interfaces.RSAKey key) throws java.io.IOException
rsaDecrypt
in interface CryptoHelper
cipheredData
- Datos a desencriptarkey
- Clava RSA de descifradojava.io.IOException
- Si ocurre algún problema durante el
desencriptadopublic byte[] rsaEncrypt(byte[] data, java.security.interfaces.RSAKey key) throws java.io.IOException
rsaEncrypt
in interface CryptoHelper
data
- Datos a encriptarkey
- Clava RSA de cifradojava.io.IOException
- Si ocurre algún problema durante el
encriptadopublic java.security.cert.X509Certificate generateCertificate(byte[] encode) throws java.security.cert.CertificateException
generateCertificate
in interface CryptoHelper
encode
- Codificación del certificadojava.security.cert.CertificateException
- Si ocurre algún problema durante la
generaciónpublic byte[] generateRandomBytes(int numBytes) throws java.io.IOException
generateRandomBytes
in interface CryptoHelper
numBytes
- Número de bytes aleatorios que generarjava.io.IOException
- Si ocurre algún problema durante la
generación
del aleatorio