Class AmazonCorrettoCryptoProvider
- java.lang.Object
-
- java.util.Dictionary<K,V>
-
- java.util.Hashtable<java.lang.Object,java.lang.Object>
-
- java.util.Properties
-
- java.security.Provider
-
- com.amazon.corretto.crypto.provider.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
-
-
Field Summary
Fields Modifier and Type Field Description static AmazonCorrettoCryptoProviderINSTANCEstatic java.lang.StringPROVIDER_NAME
-
Constructor Summary
Constructors Constructor Description AmazonCorrettoCryptoProvider()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddExtraChecks(ExtraCheck... checks)voidassertHealthy()Throws an instance ofRuntimeCryptoExceptionif this library is not currently functional.booleanequals(java.lang.Object o)java.lang.StringgetAwsLcVersionStr()java.util.Set<ExtraCheck>getExtraChecks()java.lang.ThrowablegetLoadingError()Returns anyThrowablethrown bySystem.loadLibrary(String)when trying to initialize this library.SelfTestStatusgetSelfTestStatus()Queries (but does not run) all available self-test functionality and returns the result.java.lang.StringgetVersionStr()booleanhasExtraCheck(ExtraCheck mode)inthashCode()static voidinstall()Installs the AmazonCorrettoCryptoProvider provider as the highest-priority (i.e.booleanisExperimentalFips()ACCP-FIPS uses the FIPS branches/releases of AWS-LC.booleanisFips()Returnstrueif and only if the underlying libcrypto library is a FIPS buildvoidregisterEcParams()Register ACCP's EC-flavored AlgorithmParameters implementationSelfTestStatusrunSelfTests()Runs all available self-tests and returns the result.java.lang.StringtoString()-
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
-
-
-
-
Field Detail
-
INSTANCE
public static final AmazonCorrettoCryptoProvider INSTANCE
-
PROVIDER_NAME
public static final java.lang.String PROVIDER_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getVersionStr
public java.lang.String getVersionStr()
- Overrides:
getVersionStrin classjava.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.FAILEDwill be returned if any tests have failed. Otherwise,SelfTestStatus.NOT_RUNwill be returned if any tests have not be run.SelfTestStatus.PASSEDwill 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 seegetSelfTestStatus()for the algorithms tested and the possible return values. (though this method will never returnSelfTestStatus.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 anyThrowablethrown bySystem.loadLibrary(String)when trying to initialize this library. Returnsnullif everything loaded successfully.
-
assertHealthy
public void assertHealthy() throws RuntimeCryptoExceptionThrows an instance ofRuntimeCryptoExceptionif this library is not currently functional. Otherwise does nothing.This library is considered healthy if
getLoadingError()returnsnullandrunSelfTests()returnsSelfTestStatus.PASSED.- Throws:
RuntimeCryptoException
-
isFips
public boolean isFips()
Returnstrueif 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
trueif and only if the underlying ACCP is built in experimental fips mode.
-
registerEcParams
public void registerEcParams()
Register ACCP's EC-flavored AlgorithmParameters implementationMost 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:
equalsin interfacejava.util.Map<java.lang.Object,java.lang.Object>- Overrides:
equalsin classjava.util.Properties
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfacejava.util.Map<java.lang.Object,java.lang.Object>- Overrides:
hashCodein classjava.util.Properties
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.security.Provider
-
getExtraChecks
public java.util.Set<ExtraCheck> getExtraChecks()
-
hasExtraCheck
public boolean hasExtraCheck(ExtraCheck mode)
-
addExtraChecks
public void addExtraChecks(ExtraCheck... checks)
-
-