public final class EncryptionUtils extends Object
Modifier and Type | Method and Description |
---|---|
static WSDataRef |
decryptEncryptedData(Document doc,
String dataRefURI,
Element encData,
SecretKey symmetricKey,
String symEncAlgo,
CallbackHandler attachmentCallbackHandler)
Decrypt the EncryptedData argument using a SecretKey.
|
static Element |
findEncryptedDataElement(Document doc,
WSDocInfo wsDocInfo,
String dataRefURI)
Look up the encrypted data.
|
static Element |
getCipherValueFromEncryptedData(Element encData) |
static byte[] |
getDecodedBase64EncodedData(Element element)
Method getDecodedBase64EncodedData
|
static String |
getDigestAlgorithm(Node encBodyData) |
static String |
getMGFAlgorithm(Node encBodyData) |
static byte[] |
getPSource(Node encBodyData) |
static String |
getXOPURIFromCipherValue(Element cipherValue) |
static String |
getXPath(Node decryptedNode) |
public static Element findEncryptedDataElement(Document doc, WSDocInfo wsDocInfo, String dataRefURI) throws WSSecurityException
doc
- The document in which to find EncryptedDatawsDocInfo
- The WSDocInfo object to usedataRefURI
- The URI of EncryptedDataWSSecurityException
- if the EncryptedData element referenced by dataRefURI is
not foundpublic static WSDataRef decryptEncryptedData(Document doc, String dataRefURI, Element encData, SecretKey symmetricKey, String symEncAlgo, CallbackHandler attachmentCallbackHandler) throws WSSecurityException
doc
- The (document) owner of EncryptedDatadataRefURI
- The URI of EncryptedDataencData
- The EncryptedData elementsymmetricKey
- The SecretKey with which to decrypt EncryptedDatasymEncAlgo
- The symmetric encryption algorithm to useattachmentCallbackHandler
- The CallbackHandler from which to get attachmentsWSSecurityException
public static Element getCipherValueFromEncryptedData(Element encData)
public static String getXPath(Node decryptedNode)
decryptedNode
- the decrypted nodenull
otherwisepublic static String getDigestAlgorithm(Node encBodyData) throws WSSecurityException
WSSecurityException
public static String getMGFAlgorithm(Node encBodyData) throws WSSecurityException
WSSecurityException
public static byte[] getPSource(Node encBodyData) throws WSSecurityException
WSSecurityException
public static byte[] getDecodedBase64EncodedData(Element element) throws WSSecurityException
element
- WSSecurityException
Copyright © 2016 JBoss by Red Hat. All rights reserved.