Top Description Fields Constructors Methods
org.conscrypt

public final Class OpenSSLSignatureRawRSA

extends SignatureSpi
Class Inheritance
Annotations
@Internal
Imports
java.security.InvalidKeyException, .InvalidParameterException, .PrivateKey, .PublicKey, .SignatureException, .SignatureSpi, java.security.interfaces.RSAPrivateCrtKey, .RSAPrivateKey, .RSAPublicKey

Implements the JDK Signature interface needed for RAW RSA signature generation and verification using BoringSSL.

Field Summary

Modifier and TypeField and Description
private byte[]
inputBuffer

Buffer to hold value to be signed or verified.

private boolean
inputIsTooLong

Provides a flag to specify when the input is too long.

private int
inputOffset

Current offset in input buffer.

private OpenSSLKey
key

The current OpenSSL key we're operating on.

Inherited from java.security.SignatureSpi:
appRandom

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected Object
engineGetParameter(String
the string name of the parameter.
param
)

Implements abstract java.security.SignatureSpi.engineGetParameter.

Gets the value of the specified algorithm parameter.
protected void
engineInitSign(PrivateKey
the private key of the identity whose signature will be generated.
privateKey
)

Implements abstract java.security.SignatureSpi.engineInitSign.

Initializes this Signature object with the specified private key for signing operations.
protected void
engineInitVerify(PublicKey
the public key of the identity whose signature is going to be verified.
publicKey
)

Implements abstract java.security.SignatureSpi.engineInitVerify.

Initializes this Signature object with the specified public key for verification operations.
protected void
engineSetParameter(String
the string identifier of the parameter.
param
,
Object
the parameter value.
value
)

Implements abstract java.security.SignatureSpi.engineSetParameter.

Sets the specified algorithm parameter to the specified value.
protected byte[]
engineSign()

Implements abstract java.security.SignatureSpi.engineSign.

Returns the signature bytes of all the data updated so far.
protected void
engineUpdate(byte
the byte to use for the update.
input
)

Implements abstract java.security.SignatureSpi.engineUpdate.

Updates the data to be signed or verified using the specified byte.
protected void
engineUpdate(byte[]
the array of bytes
input
,
int
the offset to start from in the array of bytes
offset
,
int
the number of bytes to use, starting at offset
len
)

Implements abstract java.security.SignatureSpi.engineUpdate.

Updates the data to be signed or verified, using the specified array of bytes, starting at the specified offset.
protected boolean
engineVerify(byte[]
the signature bytes to be verified.
sigBytes
)

Implements abstract java.security.SignatureSpi.engineVerify.

Verifies the passed-in signature.
Inherited from java.security.SignatureSpi:
cloneengineGetParametersengineInitSignengineSetParameterengineSignengineUpdateengineVerify

Field Detail

inputBufferback to summary
private byte[] inputBuffer

Buffer to hold value to be signed or verified.

inputIsTooLongback to summary
private boolean inputIsTooLong

Provides a flag to specify when the input is too long.

inputOffsetback to summary
private int inputOffset

Current offset in input buffer.

keyback to summary
private OpenSSLKey key

The current OpenSSL key we're operating on.

Constructor Detail

OpenSSLSignatureRawRSAback to summary
public OpenSSLSignatureRawRSA()

Method Detail

engineGetParameterback to summary
protected Object engineGetParameter(String param) throws InvalidParameterException

Implements abstract java.security.SignatureSpi.engineGetParameter.

Doc from java.security.SignatureSpi.engineGetParameter.

Gets the value of the specified algorithm parameter. This method supplies a general-purpose mechanism through which it is possible to get the various parameters of this object. A parameter may be any settable parameter for the algorithm, such as a parameter size, or a source of random bits for signature generation (if appropriate), or an indication of whether to perform a specific but optional computation. A uniform algorithm-specific naming scheme for each parameter is desirable but left unspecified at this time.

Parameters
param:String

the string name of the parameter.

Returns:Object

the object that represents the parameter value, or null if there is none.

Annotations
@Override
@SuppressWarnings:deprecation
Exceptions
InvalidParameterException:
if param is an invalid parameter for this engine, or another exception occurs while trying to get this parameter.
engineInitSignback to summary
protected void engineInitSign(PrivateKey privateKey) throws InvalidKeyException

Implements abstract java.security.SignatureSpi.engineInitSign.

Doc from java.security.SignatureSpi.engineInitSign.

Initializes this Signature object with the specified private key for signing operations.

Parameters
privateKey:PrivateKey

the private key of the identity whose signature will be generated.

Annotations
@Override
Exceptions
InvalidKeyException:
if the key is improperly encoded, parameters are missing, and so on.
engineInitVerifyback to summary
protected void engineInitVerify(PublicKey publicKey) throws InvalidKeyException

Implements abstract java.security.SignatureSpi.engineInitVerify.

Doc from java.security.SignatureSpi.engineInitVerify.

Initializes this Signature object with the specified public key for verification operations.

Parameters
publicKey:PublicKey

the public key of the identity whose signature is going to be verified.

Annotations
@Override
Exceptions
InvalidKeyException:
if the key is improperly encoded, parameters are missing, and so on.
engineSetParameterback to summary
protected void engineSetParameter(String param, Object value) throws InvalidParameterException

Implements abstract java.security.SignatureSpi.engineSetParameter.

Doc from java.security.SignatureSpi.engineSetParameter.

Sets the specified algorithm parameter to the specified value. This method supplies a general-purpose mechanism through which it is possible to set the various parameters of this object. A parameter may be any settable parameter for the algorithm, such as a parameter size, or a source of random bits for signature generation (if appropriate), or an indication of whether to perform a specific but optional computation. A uniform algorithm-specific naming scheme for each parameter is desirable but left unspecified at this time.

Parameters
param:String

the string identifier of the parameter.

value:Object

the parameter value.

Annotations
@Override
@SuppressWarnings:deprecation
Exceptions
InvalidParameterException:
if param is an invalid parameter for this Signature object, the parameter is already set and cannot be set again, a security exception occurs, and so on.
engineSignback to summary
protected byte[] engineSign() throws SignatureException

Implements abstract java.security.SignatureSpi.engineSign.

Doc from java.security.SignatureSpi.engineSign.

Returns the signature bytes of all the data updated so far. The format of the signature depends on the underlying signature scheme.

Returns:byte[]

the signature bytes of the signing operation's result.

Annotations
@Override
Exceptions
SignatureException:
if the engine is not initialized properly or if this signature algorithm is unable to process the input data provided.
engineUpdateback to summary
protected void engineUpdate(byte input)

Implements abstract java.security.SignatureSpi.engineUpdate.

Doc from java.security.SignatureSpi.engineUpdate.

Updates the data to be signed or verified using the specified byte.

Parameters
input:byte

the byte to use for the update.

Annotations
@Override
engineUpdateback to summary
protected void engineUpdate(byte[] input, int offset, int len)

Implements abstract java.security.SignatureSpi.engineUpdate.

Doc from java.security.SignatureSpi.engineUpdate.

Updates the data to be signed or verified, using the specified array of bytes, starting at the specified offset.

Parameters
input:byte[]

the array of bytes

offset:int

the offset to start from in the array of bytes

len:int

the number of bytes to use, starting at offset

Annotations
@Override
engineVerifyback to summary
protected boolean engineVerify(byte[] sigBytes) throws SignatureException

Implements abstract java.security.SignatureSpi.engineVerify.

Doc from java.security.SignatureSpi.engineVerify.

Verifies the passed-in signature.

Parameters
sigBytes:byte[]

the signature bytes to be verified.

Returns:boolean

true if the signature was verified, false if not.

Annotations
@Override
Exceptions
SignatureException:
if the engine is not initialized properly, the passed-in signature is improperly encoded or of the wrong type, if this signature algorithm is unable to process the input data provided, etc.