public class TrustUtil extends Object
| Constructor and Description |
|---|
TrustUtil() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.axiom.om.OMElement |
createActAsElement(org.apache.axiom.om.OMElement parent,
int version,
org.apache.axiom.om.OMElement samlToken)
This method is used to create and add the "ActAs" element into a RST as per the wS-Trust 1.4 specification.
|
static org.apache.axiom.om.OMElement |
createAppliesToElement(org.apache.axiom.om.OMElement parent,
String address,
String addressingNs) |
static org.apache.axiom.om.OMElement |
createBinarySecretElement(int version,
org.apache.axiom.om.OMElement parent,
String type) |
static org.apache.axiom.om.OMElement |
createCancelRequest(String tokenId,
int version) |
static org.apache.axiom.om.OMElement |
createCancelTargetElement(int version,
org.apache.axiom.om.OMElement parent) |
static org.apache.axiom.om.OMElement |
createClaims(int version,
org.apache.axiom.om.OMElement parent,
String dialect) |
static org.apache.axiom.om.OMElement |
createComputedKeyAlgorithm(int version,
org.apache.axiom.om.OMElement parent,
String algoId) |
static org.apache.axiom.om.OMElement |
createComputedKeyElement(int version,
org.apache.axiom.om.OMElement parent) |
static org.apache.axiom.om.OMElement |
createEntropyElement(int version,
org.apache.axiom.om.OMElement parent) |
static org.apache.axiom.om.OMElement |
createKeySizeElement(int version,
org.apache.axiom.om.OMElement parent,
int size) |
static org.apache.axiom.om.OMElement |
createKeyTypeElement(int version,
org.apache.axiom.om.OMElement parent,
String type) |
static org.apache.axiom.om.OMElement |
createLifetimeElement(int version,
org.apache.axiom.om.OMElement parent,
long ttl) |
static org.apache.axiom.om.OMElement |
createLifetimeElement(int version,
org.apache.axiom.om.OMElement parent,
String created,
String expires) |
static org.apache.axiom.om.OMElement |
createRenewTargetElement(int version,
org.apache.axiom.om.OMElement parent,
org.apache.axiom.om.OMElement str) |
static org.apache.axiom.om.OMElement |
createRequestedAttachedRef(int version,
org.apache.axiom.om.OMElement parent,
String refUri,
String refValueType) |
static void |
createRequestedAttachedRef(org.apache.axiom.om.OMElement rstrElem,
String id,
int version)
Create and add wst:AttachedReference element
|
static org.apache.axiom.om.OMElement |
createRequestedProofTokenElement(int version,
org.apache.axiom.om.OMElement parent) |
static org.apache.axiom.om.OMElement |
createRequestedSecurityTokenElement(int version,
org.apache.axiom.om.OMElement parent) |
static org.apache.axiom.om.OMElement |
createRequestedTokenCanceledElement(int version,
org.apache.axiom.om.OMElement parent) |
static org.apache.axiom.om.OMElement |
createRequestedUnattachedRef(int version,
org.apache.axiom.om.OMElement parent,
String refUri,
String refValueType) |
static void |
createRequestedUnattachedRef(org.apache.axiom.om.OMElement rstrElem,
String id,
int version)
Create and add wst:UnattachedReference element
|
static org.apache.axiom.om.OMElement |
createRequestSecurityTokenElement(int version) |
static org.apache.axiom.om.OMElement |
createRequestSecurityTokenResponseCollectionElement(int version,
org.apache.axiom.om.OMElement parent) |
static org.apache.axiom.om.OMElement |
createRequestSecurityTokenResponseElement(int version,
org.apache.axiom.om.OMElement parent) |
static org.apache.axiom.om.OMElement |
createRequestTypeElement(int version,
org.apache.axiom.om.OMElement parent,
String value) |
static Element |
createSecurityTokenReference(Document doc,
String refUri,
String refValueType)
Create a wsse:Reference element with the given URI and the value type
|
static Element |
createSecurityTokenReferenceWithTokenType(Document doc,
String refUri,
String refValueType,
String tokenType) |
static org.apache.axiom.soap.SOAPEnvelope |
createSOAPEnvelope(String nsUri)
Create a new
SOAPEnvelope of the same version as the
SOAPEnvelope in the given MessageContext |
static org.apache.axiom.om.OMElement |
createTokenTypeElement(int version,
org.apache.axiom.om.OMElement parent) |
static org.apache.axiom.om.OMElement |
createValidateTargetElement(int version,
org.apache.axiom.om.OMElement parent,
org.apache.axiom.om.OMElement str) |
protected byte[] |
generateEphemeralKey(byte[] reqEnt,
byte[] respEnt,
String algo,
int keySize)
Create an ephemeral key
|
protected byte[] |
generateEphemeralKey(int keySize)
Create an ephemeral key
|
static String |
getActionValue(int version,
String action) |
static String |
getSAML11SubjectConfirmationMethod(org.opensaml.SAMLAssertion assertion)
Get subject confirmation method of the given SAML 1.1 Assertion
|
static String |
getSAML2SubjectConfirmationMethod(org.opensaml.saml2.core.Assertion assertion)
Get the subject confirmation method of a SAML 2.0 assertion
|
static DocumentBuilderFactory |
getSecuredDocumentBuilderFactory()
Create DocumentBuilderFactory with the XXE and XEE prevention measurements
|
static TokenStorage |
getTokenStore(org.apache.axis2.context.ConfigurationContext ctx)
Fetches the token storage from the configuration context.
|
static TokenStorage |
getTokenStore(org.apache.axis2.context.MessageContext msgCtx)
Returns the token store.
|
static String |
getWSTNamespace(int version) |
static String |
getWSTNamespaceForRSTRequestTye(int version)
This method is intended to provide the correct RST Request type provided the WS-Trust version.
|
static int |
getWSTVersion(String ns) |
static boolean |
isDoomParserPoolUsed()
Check whether we need to set a DOOMBuilderFactory based parser pool for the OpenSAML library
DOOMBuilderFactory based parser pool was required to overcome the concurrency issue between STS ans SAML
when used in the same JVM.
|
static Properties |
toProperties(org.apache.axiom.om.OMElement cryptoElem) |
public static Element createSecurityTokenReference(Document doc, String refUri, String refValueType)
doc - refUri - refValueType - public static Element createSecurityTokenReferenceWithTokenType(Document doc, String refUri, String refValueType, String tokenType)
public static org.apache.axiom.om.OMElement createRequestSecurityTokenResponseElement(int version,
org.apache.axiom.om.OMElement parent)
throws TrustException
TrustExceptionpublic static org.apache.axiom.om.OMElement createRequestSecurityTokenResponseCollectionElement(int version,
org.apache.axiom.om.OMElement parent)
throws TrustException
TrustExceptionpublic static org.apache.axiom.om.OMElement createRequestedSecurityTokenElement(int version,
org.apache.axiom.om.OMElement parent)
throws TrustException
TrustExceptionpublic static org.apache.axiom.om.OMElement createRequestSecurityTokenElement(int version)
throws TrustException
TrustExceptionpublic static org.apache.axiom.om.OMElement createRequestedProofTokenElement(int version,
org.apache.axiom.om.OMElement parent)
throws TrustException
TrustExceptionpublic static org.apache.axiom.om.OMElement createEntropyElement(int version,
org.apache.axiom.om.OMElement parent)
throws TrustException
TrustExceptionpublic static org.apache.axiom.om.OMElement createComputedKeyElement(int version,
org.apache.axiom.om.OMElement parent)
throws TrustException
TrustExceptionpublic static org.apache.axiom.om.OMElement createRequestTypeElement(int version,
org.apache.axiom.om.OMElement parent,
String value)
throws TrustException
TrustExceptionpublic static org.apache.axiom.om.OMElement createTokenTypeElement(int version,
org.apache.axiom.om.OMElement parent)
throws TrustException
TrustExceptionpublic static org.apache.axiom.om.OMElement createValidateTargetElement(int version,
org.apache.axiom.om.OMElement parent,
org.apache.axiom.om.OMElement str)
throws TrustException
TrustExceptionpublic static org.apache.axiom.om.OMElement createRenewTargetElement(int version,
org.apache.axiom.om.OMElement parent,
org.apache.axiom.om.OMElement str)
throws TrustException
TrustExceptionpublic static org.apache.axiom.om.OMElement createBinarySecretElement(int version,
org.apache.axiom.om.OMElement parent,
String type)
throws TrustException
TrustExceptionpublic static org.apache.axiom.om.OMElement createComputedKeyAlgorithm(int version,
org.apache.axiom.om.OMElement parent,
String algoId)
throws TrustException
TrustExceptionpublic static org.apache.axiom.om.OMElement createRequestedUnattachedRef(int version,
org.apache.axiom.om.OMElement parent,
String refUri,
String refValueType)
throws TrustException
TrustExceptionpublic static org.apache.axiom.om.OMElement createRequestedAttachedRef(int version,
org.apache.axiom.om.OMElement parent,
String refUri,
String refValueType)
throws TrustException
TrustExceptionpublic static void createRequestedAttachedRef(org.apache.axiom.om.OMElement rstrElem,
String id,
int version)
throws TrustException
rstrElem - wst:RequestSecurityToken elementid - Token identifierTrustExceptionpublic static void createRequestedUnattachedRef(org.apache.axiom.om.OMElement rstrElem,
String id,
int version)
throws TrustException
rstrElem - wst:RequestSecurityToken elementid - Token identifierTrustExceptionpublic static org.apache.axiom.om.OMElement createKeySizeElement(int version,
org.apache.axiom.om.OMElement parent,
int size)
throws TrustException
TrustExceptionpublic static org.apache.axiom.om.OMElement createKeyTypeElement(int version,
org.apache.axiom.om.OMElement parent,
String type)
throws TrustException
TrustExceptionpublic static org.apache.axiom.om.OMElement createRequestedTokenCanceledElement(int version,
org.apache.axiom.om.OMElement parent)
throws TrustException
TrustExceptionpublic static org.apache.axiom.om.OMElement createLifetimeElement(int version,
org.apache.axiom.om.OMElement parent,
String created,
String expires)
throws TrustException
TrustExceptionpublic static org.apache.axiom.om.OMElement createLifetimeElement(int version,
org.apache.axiom.om.OMElement parent,
long ttl)
throws TrustException
TrustExceptionpublic static org.apache.axiom.om.OMElement createAppliesToElement(org.apache.axiom.om.OMElement parent,
String address,
String addressingNs)
public static String getActionValue(int version, String action) throws TrustException
TrustExceptionpublic static org.apache.axiom.soap.SOAPEnvelope createSOAPEnvelope(String nsUri)
SOAPEnvelope of the same version as the
SOAPEnvelope in the given MessageContextnsUri - public static String getWSTNamespace(int version) throws TrustException
TrustExceptionpublic static int getWSTVersion(String ns) throws TrustException
TrustExceptionpublic static TokenStorage getTokenStore(org.apache.axis2.context.MessageContext msgCtx)
msgCtx - public static TokenStorage getTokenStore(org.apache.axis2.context.ConfigurationContext ctx)
ctx - protected byte[] generateEphemeralKey(int keySize)
throws TrustException
TrustExceptionprotected byte[] generateEphemeralKey(byte[] reqEnt,
byte[] respEnt,
String algo,
int keySize)
throws TrustException
TrustExceptionpublic static org.apache.axiom.om.OMElement createCancelTargetElement(int version,
org.apache.axiom.om.OMElement parent)
throws TrustException
TrustExceptionpublic static org.apache.axiom.om.OMElement createClaims(int version,
org.apache.axiom.om.OMElement parent,
String dialect)
throws TrustException
TrustExceptionpublic static org.apache.axiom.om.OMElement createCancelRequest(String tokenId, int version) throws TrustException
TrustExceptionpublic static Properties toProperties(org.apache.axiom.om.OMElement cryptoElem)
public static String getSAML11SubjectConfirmationMethod(org.opensaml.SAMLAssertion assertion)
assertion - SAML 1.1 Assertionpublic static String getSAML2SubjectConfirmationMethod(org.opensaml.saml2.core.Assertion assertion)
assertion - SAML 2.0 assertionpublic static String getWSTNamespaceForRSTRequestTye(int version) throws TrustException
version - TrustExceptionpublic static org.apache.axiom.om.OMElement createActAsElement(org.apache.axiom.om.OMElement parent,
int version,
org.apache.axiom.om.OMElement samlToken)
throws TrustException
parent - version - samlToken - TrustExceptionpublic static DocumentBuilderFactory getSecuredDocumentBuilderFactory()
public static boolean isDoomParserPoolUsed()
Copyright © 2005–2019 Apache Software Foundation. All rights reserved.