Top Description Fields Constructors Methods
com.oracle.bmc.http.signing.internal

public Class SignatureSigner

extends Object
Class Inheritance
Imports
java.security.InvalidKeyException, .NoSuchAlgorithmException, .Signature, .SignatureException, java.security.interfaces.RSAPrivateKey, jakarta.annotation.Nonnull, com.oracle.bmc.util.internal.Validate

The SignatureSigner is used to actually sign a message with a private key. This version is specific to RSA.

Class is immutable. @Immutable

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

an RSA signature of the message made using given private key and algorithm
sign
(final RSAPrivateKey
the private key to use to sign the message
privateKey
,
final byte[]
the message to sign, must not be null or empty
message
,
final String
the algorithm to sign
algorithm
)

Sign the given message using the given private key

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGback to summary
private static final Logger LOG

Constructor Detail

SignatureSignerback to summary
public SignatureSigner()

Method Detail

signback to summary
public byte[] sign(final RSAPrivateKey privateKey, final byte[] message, final String algorithm)

Sign the given message using the given private key

Parameters
privateKey:RSAPrivateKey

the private key to use to sign the message

message:byte[]

the message to sign, must not be null or empty

algorithm:String

the algorithm to sign

Returns:byte[]

an RSA signature of the message made using given private key and algorithm

Annotations
@Nonnull
Exceptions
SignedRequestException:
if algorithm is invalid, key is invalid or signing fails