org.bouncycastle.jcajce.provider.symmetric.util
Class ChaCha20SpecUtil
java.lang.Object
org.bouncycastle.jcajce.provider.symmetric.util.ChaCha20SpecUtil
- public class ChaCha20SpecUtil
- extends java.lang.Object
Converts the JDK's (Java 11 and later) into the BC equivalent,
BCChaCha20ParameterSpec, so the provider only has to handle the BC type.
This copy works by reflection, so it compiles for any Java version and finds the JDK class wherever the
runtime has it - including from the legacy distributions, which carry no multi-release overlays. The jdk1.11
copy uses the class directly. The two copies must keep the same public members: a caller compiled against this
one is paired at runtime with whichever copy the JVM loads.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ChaCha20SpecUtil
public ChaCha20SpecUtil()
toBCChaCha20Spec
public static BCChaCha20ParameterSpec toBCChaCha20Spec(java.security.spec.AlgorithmParameterSpec paramSpec)
throws java.security.InvalidAlgorithmParameterException
- Convert a into the BC equivalent.
- Parameters:
paramSpec - the parameter spec to convert, may be null.
- Returns:
- the equivalent
BCChaCha20ParameterSpec, or null if paramSpec is not a
.
- Throws:
java.security.InvalidAlgorithmParameterException - if paramSpec is one, but its values cannot be read.