Package org.conscrypt
Class OAEPParameters
- java.lang.Object
-
- java.security.AlgorithmParametersSpi
-
- org.conscrypt.OAEPParameters
-
@Internal public class OAEPParameters extends java.security.AlgorithmParametersSpi
AlgorithmParameters implementation for OAEP. The only supported encoding format is ASN.1, as specified in RFC 4055 section 4.1.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
MGF1_OID
private static java.util.Map<java.lang.String,java.lang.String>
NAME_TO_OID
private static java.util.Map<java.lang.String,java.lang.String>
OID_TO_NAME
private static java.lang.String
PSPECIFIED_OID
private javax.crypto.spec.OAEPParameterSpec
spec
-
Constructor Summary
Constructors Constructor Description OAEPParameters()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected byte[]
engineGetEncoded()
protected byte[]
engineGetEncoded(java.lang.String format)
protected <T extends java.security.spec.AlgorithmParameterSpec>
TengineGetParameterSpec(java.lang.Class<T> aClass)
protected void
engineInit(byte[] bytes)
protected void
engineInit(byte[] bytes, java.lang.String format)
protected void
engineInit(java.security.spec.AlgorithmParameterSpec algorithmParameterSpec)
protected java.lang.String
engineToString()
private static java.lang.String
getHashName(long hashRef)
(package private) static java.lang.String
readHash(long seqRef)
(package private) static java.lang.String
readMgfHash(long seqRef)
private static long
writeAlgorithmIdentifier(long container, java.lang.String oid)
Writes an ASN.1 AlgorithmIdentifier structure into container, which looks like(package private) static void
writeHashAndMgfHash(long seqRef, java.lang.String hash, java.security.spec.MGF1ParameterSpec mgfSpec)
-
-
-
Field Detail
-
OID_TO_NAME
private static final java.util.Map<java.lang.String,java.lang.String> OID_TO_NAME
-
NAME_TO_OID
private static final java.util.Map<java.lang.String,java.lang.String> NAME_TO_OID
-
MGF1_OID
private static final java.lang.String MGF1_OID
- See Also:
- Constant Field Values
-
PSPECIFIED_OID
private static final java.lang.String PSPECIFIED_OID
- See Also:
- Constant Field Values
-
spec
private javax.crypto.spec.OAEPParameterSpec spec
-
-
Method Detail
-
engineInit
protected void engineInit(java.security.spec.AlgorithmParameterSpec algorithmParameterSpec) throws java.security.spec.InvalidParameterSpecException
- Specified by:
engineInit
in classjava.security.AlgorithmParametersSpi
- Throws:
java.security.spec.InvalidParameterSpecException
-
engineInit
protected void engineInit(byte[] bytes) throws java.io.IOException
- Specified by:
engineInit
in classjava.security.AlgorithmParametersSpi
- Throws:
java.io.IOException
-
engineInit
protected void engineInit(byte[] bytes, java.lang.String format) throws java.io.IOException
- Specified by:
engineInit
in classjava.security.AlgorithmParametersSpi
- Throws:
java.io.IOException
-
readHash
static java.lang.String readHash(long seqRef) throws java.io.IOException
- Throws:
java.io.IOException
-
readMgfHash
static java.lang.String readMgfHash(long seqRef) throws java.io.IOException
- Throws:
java.io.IOException
-
getHashName
private static java.lang.String getHashName(long hashRef) throws java.io.IOException
- Throws:
java.io.IOException
-
engineGetParameterSpec
protected <T extends java.security.spec.AlgorithmParameterSpec> T engineGetParameterSpec(java.lang.Class<T> aClass) throws java.security.spec.InvalidParameterSpecException
- Specified by:
engineGetParameterSpec
in classjava.security.AlgorithmParametersSpi
- Throws:
java.security.spec.InvalidParameterSpecException
-
engineGetEncoded
protected byte[] engineGetEncoded() throws java.io.IOException
- Specified by:
engineGetEncoded
in classjava.security.AlgorithmParametersSpi
- Throws:
java.io.IOException
-
engineGetEncoded
protected byte[] engineGetEncoded(java.lang.String format) throws java.io.IOException
- Specified by:
engineGetEncoded
in classjava.security.AlgorithmParametersSpi
- Throws:
java.io.IOException
-
writeHashAndMgfHash
static void writeHashAndMgfHash(long seqRef, java.lang.String hash, java.security.spec.MGF1ParameterSpec mgfSpec) throws java.io.IOException
- Throws:
java.io.IOException
-
writeAlgorithmIdentifier
private static long writeAlgorithmIdentifier(long container, java.lang.String oid) throws java.io.IOException
Writes an ASN.1 AlgorithmIdentifier structure into container, which looks likeSEQUENCE OBJECT IDENTIFIER PARAMS (based on the particular algorithm)
This method returns a reference to the sequence such that the params may be added to it. The reference needs to be freed with asn1_write_free once it's used.- Throws:
java.io.IOException
-
engineToString
protected java.lang.String engineToString()
- Specified by:
engineToString
in classjava.security.AlgorithmParametersSpi
-
-