Class WSSecDerivedKeyBase

    • Constructor Detail

      • WSSecDerivedKeyBase

        public WSSecDerivedKeyBase​(WSSecHeader securityHeader)
      • WSSecDerivedKeyBase

        public WSSecDerivedKeyBase​(Document doc)
    • Method Detail

      • getDerivedKeyLength

        protected abstract int getDerivedKeyLength()
                                            throws WSSecurityException
        The derived key will change depending on the sig/encr algorithm. Therefore the child classes are expected to provide this value.
        the derived key length
      • getStrElem

        public Element getStrElem()
      • setStrElem

        public void setStrElem​(Element strElem)
      • setTokenIdentifier

        public void setTokenIdentifier​(String tokenIdentifier)
      • getTokenIdentifier

        public String getTokenIdentifier()
        Returns the tokenIdentifier.
      • setX509Certificate

        public void setX509Certificate​(X509Certificate cer)
        Set the X509 Certificate to use
        cer - the X509 Certificate to use
      • getId

        public String getId()
        Get the id generated during prepare(). Returns the the value of wsu:Id attribute of the DerivedKeyToken element.
        Return the wsu:Id of this token or null if prepare() was not called before.
      • setClientLabel

        public void setClientLabel​(String clientLabel)
        Set the label value of the client.
        clientLabel -
      • setServiceLabel

        public void setServiceLabel​(String serviceLabel)
        Set the label value of the service.
        serviceLabel -
      • prepare

        public void prepare​(byte[] ephemeralKey)
                     throws WSSecurityException
        Initialize a WSSec Derived key. The method prepares and initializes a WSSec derived key structure after the relevant information was set. This method also creates and initializes the derived token using the ephemeral key. After preparation references can be added, encrypted and signed as required. This method does not add any element to the security header. This must be done explicitly.
        ephemeralKey - The ephemeral key to use for derivation
      • prependDKElementToHeader

        public void prependDKElementToHeader()
        Prepend the DerivedKey element to the elements already in the Security header. The method can be called any time after prepare(). This allows to insert the DerivedKey element at any position in the Security header.
      • appendDKElementToHeader

        public void appendDKElementToHeader()
      • setWscVersion

        public void setWscVersion​(int wscVersion)
        wscVersion - The wscVersion to set.
      • getWscVersion

        public int getWscVersion()
      • getdktElement

        public Element getdktElement()
      • setCustomValueType

        public void setCustomValueType​(String customValueType)
      • setTokenIdDirectId

        public void setTokenIdDirectId​(boolean b)
      • setCrypto

        public void setCrypto​(Crypto crypto)