Class TrustUtil

java.lang.Object
org.apache.rahas.TrustUtil

public class TrustUtil extends Object
  • 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 element
      id - 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 element
      id - 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

      public static org.apache.axiom.om.OMElement createAppliesToElement(org.apache.axiom.om.OMElement parent, String address, String addressingNs)
    • getActionValue

      public static String getActionValue(int version, String action) throws TrustException
      Throws:
      TrustException
    • createSOAPEnvelope

      public static org.apache.axiom.soap.SOAPEnvelope createSOAPEnvelope(String nsUri)
      Create a new SOAPEnvelope of the same version as the SOAPEnvelope in the given MessageContext
      Parameters:
      nsUri -
      Returns:
      SOAPEnvelope
    • getWSTNamespace

      public static String getWSTNamespace(int version) throws TrustException
      Throws:
      TrustException
    • getWSTVersion

      public static int getWSTVersion(String ns) throws TrustException
      Throws:
      TrustException
    • getTokenStore

      public static TokenStorage getTokenStore(org.apache.axis2.context.MessageContext msgCtx)
      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

      public static TokenStorage getTokenStore(org.apache.axis2.context.ConfigurationContext ctx)
      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

      protected byte[] generateEphemeralKey(int keySize) throws TrustException
      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

      public static Properties toProperties(org.apache.axiom.om.OMElement cryptoElem)