Package es.gob.afirma.utils
Class CryptoUtilPdfBc
- java.lang.Object
-
- es.gob.afirma.utils.CryptoUtilPdfBc
-
public final class CryptoUtilPdfBc extends java.lang.ObjectUtility class contains encryption and hash functions for digital signature.
Project:Library for the integration with the services of @Firma, eVisor and TS@.
- Version:
- 1.0, 29/06/2011.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]digest(java.lang.String algorithm, byte[] data)Method that obtains the hash computation from a array bytes.static org.bouncycastle.asn1.x509.AlgorithmIdentifiergetAlgorithmIdentifierByName(java.lang.String hashAlgorithm)Method that obtains the OID of a hash algorithm from the name.static java.lang.StringgetDigestAlgorithmName(java.lang.String pseudoName)Method that gets the name of a digest algorithm by name or alias.static java.lang.StringtranslateAlgorithmIdentifier(org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier)Method that translates aAlgorithmIdentifierobject to a digest algorithm string.
-
-
-
Method Detail
-
digest
public static byte[] digest(java.lang.String algorithm, byte[] data) throws SigningExceptionMethod that obtains the hash computation from a array bytes.- Parameters:
algorithm- Parameter that represents the algorithm used in the hash computation.data- Parameter that represents the source data.- Returns:
- the hash value.
- Throws:
SigningException- If a MessageDigestSpi implementation for the specified algorithm is not available from the specified Provider object.
-
translateAlgorithmIdentifier
public static java.lang.String translateAlgorithmIdentifier(org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier)
Method that translates aAlgorithmIdentifierobject to a digest algorithm string.- Parameters:
algorithmIdentifier- Parameter that represents the OID of the digest algorithm.- Returns:
- the digest algorithm name.
-
getAlgorithmIdentifierByName
public static org.bouncycastle.asn1.x509.AlgorithmIdentifier getAlgorithmIdentifierByName(java.lang.String hashAlgorithm)
Method that obtains the OID of a hash algorithm from the name.- Parameters:
hashAlgorithm- Parameter that represents the name of the hash algorithm.- Returns:
- the OID value.
-
getDigestAlgorithmName
public static java.lang.String getDigestAlgorithmName(java.lang.String pseudoName)
Method that gets the name of a digest algorithm by name or alias.- Parameters:
pseudoName- Parameter that represents the name or alias of the digest algorithm.- Returns:
- the name of the digest algorithm.
-
-