Class ProviderDigest

  • All Implemented Interfaces:
    IExternalDigest

    public class ProviderDigest
    extends java.lang.Object
    implements IExternalDigest
    This class will return the MessageDigest associated with a certain hashing algorithm returned by the specified provider.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String provider  
    • Constructor Summary

      Constructors 
      Constructor Description
      ProviderDigest​(java.lang.String provider)
      Creates a ProviderDigest.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.security.MessageDigest getMessageDigest​(java.lang.String hashAlgorithm)
      Returns the MessageDigest associated with the provided hashing algorithm.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • provider

        private java.lang.String provider
    • Constructor Detail

      • ProviderDigest

        public ProviderDigest​(java.lang.String provider)
        Creates a ProviderDigest.
        Parameters:
        provider - String name of the provider that you want to use to create the hash
    • Method Detail

      • getMessageDigest

        public java.security.MessageDigest getMessageDigest​(java.lang.String hashAlgorithm)
                                                     throws java.security.GeneralSecurityException
        Description copied from interface: IExternalDigest
        Returns the MessageDigest associated with the provided hashing algorithm.
        Specified by:
        getMessageDigest in interface IExternalDigest
        Parameters:
        hashAlgorithm - String value representing the hashing algorithm
        Returns:
        MessageDigest MessageDigest object
        Throws:
        java.security.GeneralSecurityException - Thrown when something goes wrong in calculating the digest