Class CryptoUtilPdfBc


  • public final class CryptoUtilPdfBc
    extends java.lang.Object

    Utility 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.AlgorithmIdentifier getAlgorithmIdentifierByName​(java.lang.String hashAlgorithm)
      Method that obtains the OID of a hash algorithm from the name.
      static java.lang.String getDigestAlgorithmName​(java.lang.String pseudoName)
      Method that gets the name of a digest algorithm by name or alias.
      static java.lang.String translateAlgorithmIdentifier​(org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithmIdentifier)
      Method that translates a AlgorithmIdentifier object to a digest algorithm string.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • digest

        public static byte[] digest​(java.lang.String algorithm,
                                    byte[] data)
                             throws SigningException
        Method 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 a AlgorithmIdentifier object 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.