Class AmazonCorrettoCryptoProvider

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,​java.lang.Object>

    public final class AmazonCorrettoCryptoProvider
    extends java.security.Provider
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.security.Provider

        java.security.Provider.Service
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addExtraChecks​(ExtraCheck... checks)  
      void assertHealthy()
      Throws an instance of RuntimeCryptoException if this library is not currently functional.
      boolean equals​(java.lang.Object o)  
      java.lang.String getAwsLcVersionStr()  
      java.util.Set<ExtraCheck> getExtraChecks()  
      java.lang.Throwable getLoadingError()
      Returns any Throwable thrown by System.loadLibrary(String) when trying to initialize this library.
      SelfTestStatus getSelfTestStatus()
      Queries (but does not run) all available self-test functionality and returns the result.
      java.lang.String getVersionStr()  
      boolean hasExtraCheck​(ExtraCheck mode)  
      int hashCode()  
      static void install()
      Installs the AmazonCorrettoCryptoProvider provider as the highest-priority (i.e.
      boolean isExperimentalFips()
      ACCP-FIPS uses the FIPS branches/releases of AWS-LC.
      boolean isFips()
      Returns true if and only if the underlying libcrypto library is a FIPS build
      void registerEcParams()
      Register ACCP's EC-flavored AlgorithmParameters implementation
      SelfTestStatus runSelfTests()
      Runs all available self-tests and returns the result.
      java.lang.String toString()  
      • Methods inherited from class java.security.Provider

        clear, compute, computeIfAbsent, computeIfPresent, configure, elements, entrySet, forEach, get, getInfo, getName, getOrDefault, getProperty, getService, getServices, getVersion, isConfigured, keys, keySet, load, merge, put, putAll, putIfAbsent, putService, remove, remove, removeService, replace, replace, replaceAll, values
      • Methods inherited from class java.util.Properties

        clone, contains, containsKey, containsValue, getProperty, isEmpty, list, list, load, loadFromXML, propertyNames, rehash, save, setProperty, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AmazonCorrettoCryptoProvider

        public AmazonCorrettoCryptoProvider()
    • Method Detail

      • getVersionStr

        public java.lang.String getVersionStr()
        Overrides:
        getVersionStr in class java.security.Provider
      • getAwsLcVersionStr

        public java.lang.String getAwsLcVersionStr()
      • install

        public static void install()
        Installs the AmazonCorrettoCryptoProvider provider as the highest-priority (i.e. default) provider systemwide.
      • getSelfTestStatus

        public SelfTestStatus getSelfTestStatus()
        Queries (but does not run) all available self-test functionality and returns the result. SelfTestStatus.FAILED will be returned if any tests have failed. Otherwise, SelfTestStatus.NOT_RUN will be returned if any tests have not be run. SelfTestStatus.PASSED will only be returned if all tests have been run and have all passed.

        Algorithms currently run by this method:

        • NIST800-90A/AES-CTR-256
        • HMacSHA512
        • HMacSHA384
        • HMacSHA256
        • HMacSHA1
        • HMacMD5
        See Also:
        runSelfTests()
      • runSelfTests

        public SelfTestStatus runSelfTests()
        Runs all available self-tests and returns the result. Please see getSelfTestStatus() for the algorithms tested and the possible return values. (though this method will never return SelfTestStatus.NOT_RUN). The result of running tests are cached, and the subsequent calls would avoid re-running tests. To modify this behaviour, one can set the system property com.amazon.corretto.crypto.provider.cacheselftestresults=false so that every call to this method would result in re-running tests.
        See Also:
        getSelfTestStatus()
      • getLoadingError

        public java.lang.Throwable getLoadingError()
        Returns any Throwable thrown by System.loadLibrary(String) when trying to initialize this library. Returns null if everything loaded successfully.
      • isFips

        public boolean isFips()
        Returns true if and only if the underlying libcrypto library is a FIPS build
      • isExperimentalFips

        public boolean isExperimentalFips()
        ACCP-FIPS uses the FIPS branches/releases of AWS-LC. Experimental FIPS mode is to allow building ACCP and AWS-LC in FIPS mode using non-FIPS branches/release. This allows one to experiment with features that are not in FIPS branches yet.

        Returns true if and only if the underlying ACCP is built in experimental fips mode.

      • registerEcParams

        public void registerEcParams()
        Register ACCP's EC-flavored AlgorithmParameters implementation

        Most use-cases can and should rely on JCE-provided EC AlgorithmParameters implementation as it supports more curves, is more broadly compatible, and does not affect FIPS compliance posture as the EC parameters wrapper class doesn't actually do any cryptography. Only use ACCP's EC parameters class if you will only ever encounter NIST curves or are trying to use ACCP as a stand-alone JCA provider.

      • equals

        public boolean equals​(java.lang.Object o)
        Specified by:
        equals in interface java.util.Map<java.lang.Object,​java.lang.Object>
        Overrides:
        equals in class java.util.Properties
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Map<java.lang.Object,​java.lang.Object>
        Overrides:
        hashCode in class java.util.Properties
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.security.Provider
      • getExtraChecks

        public java.util.Set<ExtraCheck> getExtraChecks()
      • hasExtraCheck

        public boolean hasExtraCheck​(ExtraCheck mode)
      • addExtraChecks

        public void addExtraChecks​(ExtraCheck... checks)