public final class SignatureUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static SignatureUtil |
getInstance()
Gets the SignatureUtil instance.
|
byte[] |
sign(PrivateKey privateKey,
String algorithm,
String message)
Signs a String using the given private key.
|
boolean |
verify(PublicKey publicKey,
String algorithm,
String message,
byte[] signatureData)
Verifies a signature of a String using the public key.
|
boolean |
verify(X509Certificate certificate,
String algorithm,
String message,
byte[] signatureData)
Verifies a signature of a String using the certificate.
|
public static SignatureUtil getInstance()
public byte[] sign(PrivateKey privateKey, String algorithm, String message) throws SignatureException
privateKey - The private key to use to sign the String.algorithm - The algorithm to use in the signing.message - The String to sign.SignatureException - If there is a problem when performing the signature.public boolean verify(X509Certificate certificate, String algorithm, String message, byte[] signatureData) throws SignatureException
certificate - The X509Certificate to use to verify the signature.algorithm - The algorithm to use in the signing.message - The String that was signed.signatureData - The byte array of the signature.SignatureException - If there is a problem when verifying the signature.public boolean verify(PublicKey publicKey, String algorithm, String message, byte[] signatureData) throws SignatureException
publicKey - The public key to use to verify the signature.algorithm - The algorithm to use in the signing.message - The String that was signed.signatureData - The byte array of the signature.SignatureException - If there is a problem when verifying the signature.Copyright © 2025 Open Identity Platform Community. All rights reserved.