Package org.apache.rahas
Class TrustUtil
java.lang.Object
org.apache.rahas.TrustUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 elementstatic 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 elementstatic 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 typestatic org.apache.axiom.soap.SOAPEnvelope
createSOAPEnvelope
(String nsUri) Create a newSOAPEnvelope
of the same version as the SOAPEnvelope in the givenMessageContext
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 keyprotected byte[]
generateEphemeralKey
(int keySize) Create an ephemeral keystatic String
getActionValue
(int version, String action) 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 int
getWSTVersion
(String ns) static Properties
toProperties
(org.apache.axiom.om.OMElement cryptoElem)
-
Constructor Details
-
TrustUtil
public TrustUtil()
-
-
Method Details
-
createSecurityTokenReference
public static Element createSecurityTokenReference(Document doc, String refUri, String refValueType) Create a wsse:Reference element with the given URI and the value type- Parameters:
doc
-refUri
-refValueType
-- Returns:
- Element
-
createRequestSecurityTokenResponseElement
public static org.apache.axiom.om.OMElement createRequestSecurityTokenResponseElement(int version, org.apache.axiom.om.OMElement parent) throws TrustException - Throws:
TrustException
-
createRequestSecurityTokenResponseCollectionElement
public static org.apache.axiom.om.OMElement createRequestSecurityTokenResponseCollectionElement(int version, org.apache.axiom.om.OMElement parent) throws TrustException - Throws:
TrustException
-
createRequestedSecurityTokenElement
public static org.apache.axiom.om.OMElement createRequestedSecurityTokenElement(int version, org.apache.axiom.om.OMElement parent) throws TrustException - Throws:
TrustException
-
createRequestSecurityTokenElement
public static org.apache.axiom.om.OMElement createRequestSecurityTokenElement(int version) throws TrustException - Throws:
TrustException
-
createRequestedProofTokenElement
public static org.apache.axiom.om.OMElement createRequestedProofTokenElement(int version, org.apache.axiom.om.OMElement parent) throws TrustException - Throws:
TrustException
-
createEntropyElement
public static org.apache.axiom.om.OMElement createEntropyElement(int version, org.apache.axiom.om.OMElement parent) throws TrustException - Throws:
TrustException
-
createComputedKeyElement
public static org.apache.axiom.om.OMElement createComputedKeyElement(int version, org.apache.axiom.om.OMElement parent) throws TrustException - Throws:
TrustException
-
createRequestTypeElement
public static org.apache.axiom.om.OMElement createRequestTypeElement(int version, org.apache.axiom.om.OMElement parent, String value) throws TrustException - Throws:
TrustException
-
createTokenTypeElement
public static org.apache.axiom.om.OMElement createTokenTypeElement(int version, org.apache.axiom.om.OMElement parent) throws TrustException - Throws:
TrustException
-
createValidateTargetElement
public static org.apache.axiom.om.OMElement createValidateTargetElement(int version, org.apache.axiom.om.OMElement parent, org.apache.axiom.om.OMElement str) throws TrustException - Throws:
TrustException
-
createRenewTargetElement
public static org.apache.axiom.om.OMElement createRenewTargetElement(int version, org.apache.axiom.om.OMElement parent, org.apache.axiom.om.OMElement str) throws TrustException - Throws:
TrustException
-
createBinarySecretElement
public static org.apache.axiom.om.OMElement createBinarySecretElement(int version, org.apache.axiom.om.OMElement parent, String type) throws TrustException - Throws:
TrustException
-
createComputedKeyAlgorithm
public static org.apache.axiom.om.OMElement createComputedKeyAlgorithm(int version, org.apache.axiom.om.OMElement parent, String algoId) throws TrustException - Throws:
TrustException
-
createRequestedUnattachedRef
public static org.apache.axiom.om.OMElement createRequestedUnattachedRef(int version, org.apache.axiom.om.OMElement parent, String refUri, String refValueType) throws TrustException - Throws:
TrustException
-
createRequestedAttachedRef
public static org.apache.axiom.om.OMElement createRequestedAttachedRef(int version, org.apache.axiom.om.OMElement parent, String refUri, String refValueType) throws TrustException - Throws:
TrustException
-
createRequestedAttachedRef
public static void createRequestedAttachedRef(org.apache.axiom.om.OMElement rstrElem, String id, int version) throws TrustException Create and add wst:AttachedReference element- Parameters:
rstrElem
- wst:RequestSecurityToken elementid
- Token identifier- Throws:
TrustException
-
createRequestedUnattachedRef
public static void createRequestedUnattachedRef(org.apache.axiom.om.OMElement rstrElem, String id, int version) throws TrustException Create and add wst:UnattachedReference element- Parameters:
rstrElem
- wst:RequestSecurityToken elementid
- Token identifier- Throws:
TrustException
-
createKeySizeElement
public static org.apache.axiom.om.OMElement createKeySizeElement(int version, org.apache.axiom.om.OMElement parent, int size) throws TrustException - Throws:
TrustException
-
createKeyTypeElement
public static org.apache.axiom.om.OMElement createKeyTypeElement(int version, org.apache.axiom.om.OMElement parent, String type) throws TrustException - Throws:
TrustException
-
createRequestedTokenCanceledElement
public static org.apache.axiom.om.OMElement createRequestedTokenCanceledElement(int version, org.apache.axiom.om.OMElement parent) throws TrustException - Throws:
TrustException
-
createLifetimeElement
public static org.apache.axiom.om.OMElement createLifetimeElement(int version, org.apache.axiom.om.OMElement parent, String created, String expires) throws TrustException - Throws:
TrustException
-
createLifetimeElement
public static org.apache.axiom.om.OMElement createLifetimeElement(int version, org.apache.axiom.om.OMElement parent, long ttl) throws TrustException - Throws:
TrustException
-
createAppliesToElement
-
getActionValue
- Throws:
TrustException
-
createSOAPEnvelope
Create a newSOAPEnvelope
of the same version as the SOAPEnvelope in the givenMessageContext
- Parameters:
nsUri
-- Returns:
- SOAPEnvelope
-
getWSTNamespace
- Throws:
TrustException
-
getWSTVersion
- Throws:
TrustException
-
getTokenStore
Returns the token store. If the token store is already available in the configuration context then fetch it and return it. If not create a new one, hook it up in the configuration context and return it- Parameters:
msgCtx
-- Returns:
- the token store
-
getTokenStore
Fetches the token storage from the configuration context. If the token store is already available in the configuration context then fetch it and return it. If not create a new one, hook it up in the configuration context and return it- Parameters:
ctx
-- Returns:
-
generateEphemeralKey
Create an ephemeral key- Returns:
- The generated ephemeral key
- Throws:
TrustException
-
generateEphemeralKey
protected byte[] generateEphemeralKey(byte[] reqEnt, byte[] respEnt, String algo, int keySize) throws TrustException Create an ephemeral key- Returns:
- The generated ephemeral key
- Throws:
TrustException
-
createCancelTargetElement
public static org.apache.axiom.om.OMElement createCancelTargetElement(int version, org.apache.axiom.om.OMElement parent) throws TrustException - Throws:
TrustException
-
createClaims
public static org.apache.axiom.om.OMElement createClaims(int version, org.apache.axiom.om.OMElement parent, String dialect) throws TrustException - Throws:
TrustException
-
createCancelRequest
public static org.apache.axiom.om.OMElement createCancelRequest(String tokenId, int version) throws TrustException - Throws:
TrustException
-
toProperties
-