Top Description Fields Constructors Methods
org.conscrypt

public Class OAEPParameters

extends AlgorithmParametersSpi
Class Inheritance
Annotations
@Internal
Imports
java.io.IOException, java.security.AlgorithmParametersSpi, java.security.spec.AlgorithmParameterSpec, .InvalidParameterSpecException, .MGF1ParameterSpec, java.util.HashMap, .Map, javax.crypto.spec.OAEPParameterSpec, .PSource

AlgorithmParameters implementation for OAEP. The only supported encoding format is ASN.1, as specified in RFC 4055 section 4.1.

Field Summary

Modifier and TypeField and Description
private static final String
private static final Map<String, String>
private static final Map<String, String>
private static final String
private OAEPParameterSpec

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected byte[]
engineGetEncoded()

Implements abstract java.security.AlgorithmParametersSpi.engineGetEncoded.

Returns the parameters in their primary encoding format.
protected byte[]
engineGetEncoded(String
the name of the encoding format.
format
)

Implements abstract java.security.AlgorithmParametersSpi.engineGetEncoded.

Returns the parameters encoded in the specified format.
protected <T extends AlgorithmParameterSpec> T
engineGetParameterSpec(Class<T>
the specification class in which the parameters should be returned.
aClass
)

Implements abstract java.security.AlgorithmParametersSpi.engineGetParameterSpec.

Returns a (transparent) specification of this parameters object.
protected void
engineInit(AlgorithmParameterSpec
the parameter specification.
algorithmParameterSpec
)

Implements abstract java.security.AlgorithmParametersSpi.engineInit.

Initializes this parameters object using the parameters specified in paramSpec.
protected void
engineInit(byte[]
the encoded parameters.
bytes
)

Implements abstract java.security.AlgorithmParametersSpi.engineInit.

Imports the specified parameters and decodes them according to the primary decoding format for parameters.
protected void
engineInit(byte[]
the encoded parameters.
bytes
,
String
the name of the decoding format.
format
)

Implements abstract java.security.AlgorithmParametersSpi.engineInit.

Imports the parameters from params and decodes them according to the specified decoding format.
protected String
engineToString()

Implements abstract java.security.AlgorithmParametersSpi.engineToString.

Returns a formatted string describing the parameters.
private static String
getHashName(long hashRef)

pack-priv static String
readHash(long seqRef)

pack-priv static String
readMgfHash(long seqRef)

private static long
writeAlgorithmIdentifier(long container, String oid)

Writes an ASN.1 AlgorithmIdentifier structure into container, which looks like

SEQUENCE
  OBJECT IDENTIFIER
  PARAMS (based on the particular algorithm)
pack-priv static void
writeHashAndMgfHash(long seqRef, String hash, MGF1ParameterSpec mgfSpec)

Field Detail

MGF1_OIDback to summary
private static final String MGF1_OID
NAME_TO_OIDback to summary
private static final Map<String, String> NAME_TO_OID
OID_TO_NAMEback to summary
private static final Map<String, String> OID_TO_NAME
PSPECIFIED_OIDback to summary
private static final String PSPECIFIED_OID
specback to summary
private OAEPParameterSpec spec

Constructor Detail

OAEPParametersback to summary
public OAEPParameters()

Method Detail

engineGetEncodedback to summary
protected byte[] engineGetEncoded() throws IOException

Implements abstract java.security.AlgorithmParametersSpi.engineGetEncoded.

Doc from java.security.AlgorithmParametersSpi.engineGetEncoded.

Returns the parameters in their primary encoding format. The primary encoding format for parameters is ASN.1, if an ASN.1 specification for this type of parameters exists.

Returns:byte[]

the parameters encoded using their primary encoding format.

Annotations
@Override
Exceptions
IOException:
on encoding errors.
engineGetEncodedback to summary
protected byte[] engineGetEncoded(String format) throws IOException

Implements abstract java.security.AlgorithmParametersSpi.engineGetEncoded.

Doc from java.security.AlgorithmParametersSpi.engineGetEncoded.

Returns the parameters encoded in the specified format. If format is null, the primary encoding format for parameters is used. The primary encoding format is ASN.1, if an ASN.1 specification for these parameters exists.

Parameters
format:String

the name of the encoding format.

Returns:byte[]

the parameters encoded using the specified encoding scheme.

Annotations
@Override
Exceptions
IOException:
on encoding errors.
engineGetParameterSpecback to summary
protected <T extends AlgorithmParameterSpec> T engineGetParameterSpec(Class<T> aClass) throws InvalidParameterSpecException

Implements abstract java.security.AlgorithmParametersSpi.engineGetParameterSpec.

Doc from java.security.AlgorithmParametersSpi.engineGetParameterSpec.

Returns a (transparent) specification of this parameters object. paramSpec identifies the specification class in which the parameters should be returned. It could, for example, be DSAParameterSpec.class, to indicate that the parameters should be returned in an instance of the DSAParameterSpec class.

Parameters
<T>
the type of the parameter specification to be returned
aClass:Class<T>

the specification class in which the parameters should be returned.

Returns:T

the parameter specification.

Annotations
@Override
@SuppressWarnings:unchecked
Exceptions
InvalidParameterSpecException:
if the requested parameter specification is inappropriate for this parameter object.
engineInitback to summary
protected void engineInit(AlgorithmParameterSpec algorithmParameterSpec) throws InvalidParameterSpecException

Implements abstract java.security.AlgorithmParametersSpi.engineInit.

Doc from java.security.AlgorithmParametersSpi.engineInit.

Initializes this parameters object using the parameters specified in paramSpec.

Parameters
algorithmParameterSpec:AlgorithmParameterSpec

the parameter specification.

Annotations
@Override
Exceptions
InvalidParameterSpecException:
if the given parameter specification is inappropriate for the initialization of this parameter object.
engineInitback to summary
protected void engineInit(byte[] bytes) throws IOException

Implements abstract java.security.AlgorithmParametersSpi.engineInit.

Doc from java.security.AlgorithmParametersSpi.engineInit.

Imports the specified parameters and decodes them according to the primary decoding format for parameters. The primary decoding format for parameters is ASN.1, if an ASN.1 specification for this type of parameters exists.

Parameters
bytes:byte[]

the encoded parameters.

Annotations
@Override
Exceptions
IOException:
on decoding errors
engineInitback to summary
protected void engineInit(byte[] bytes, String format) throws IOException

Implements abstract java.security.AlgorithmParametersSpi.engineInit.

Doc from java.security.AlgorithmParametersSpi.engineInit.

Imports the parameters from params and decodes them according to the specified decoding format. If format is null, the primary decoding format for parameters is used. The primary decoding format is ASN.1, if an ASN.1 specification for these parameters exists.

Parameters
bytes:byte[]

the encoded parameters.

format:String

the name of the decoding format.

Annotations
@Override
Exceptions
IOException:
on decoding errors
engineToStringback to summary
protected String engineToString()

Implements abstract java.security.AlgorithmParametersSpi.engineToString.

Doc from java.security.AlgorithmParametersSpi.engineToString.

Returns a formatted string describing the parameters.

Returns:String

a formatted string describing the parameters.

Annotations
@Override
getHashNameback to summary
private static String getHashName(long hashRef) throws IOException
readHashback to summary
pack-priv static String readHash(long seqRef) throws IOException
readMgfHashback to summary
pack-priv static String readMgfHash(long seqRef) throws IOException
writeAlgorithmIdentifierback to summary
private static long writeAlgorithmIdentifier(long container, String oid) throws IOException

Writes an ASN.1 AlgorithmIdentifier structure into container, which looks like

SEQUENCE
  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.
writeHashAndMgfHashback to summary
pack-priv static void writeHashAndMgfHash(long seqRef, String hash, MGF1ParameterSpec mgfSpec) throws IOException