public class SignatureUtil extends Object
Constructor and Description |
---|
SignatureUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
getXMLSignatureAlgorithmURI(String algo)
Get the XML Signature URI for the algo (RSA, DSA)
|
static byte[] |
sign(String stringToBeSigned,
PrivateKey signingKey)
Sign a string using the private key
|
static boolean |
validate(byte[] signedContent,
byte[] signatureValue,
PublicKey validatingKey)
Validate the signed content with the signature value
|
static boolean |
validate(byte[] signedContent,
byte[] signatureValue,
String signatureAlgorithm,
X509Certificate validatingCert)
Validate the signature using a x509 certificate
|
public static String getXMLSignatureAlgorithmURI(String algo)
algo
- public static byte[] sign(String stringToBeSigned, PrivateKey signingKey) throws GeneralSecurityException
stringToBeSigned
- signingKey
- GeneralSecurityException
public static boolean validate(byte[] signedContent, byte[] signatureValue, PublicKey validatingKey) throws GeneralSecurityException
signedContent
- signatureValue
- validatingKey
- GeneralSecurityException
public static boolean validate(byte[] signedContent, byte[] signatureValue, String signatureAlgorithm, X509Certificate validatingCert) throws GeneralSecurityException
signedContent
- signatureValue
- signatureAlgorithm
- validatingCert
- GeneralSecurityException
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.