Package org.jboss.identity.federation.ws.trust

Examples of org.jboss.identity.federation.ws.trust.EntropyType


         // get the key wrap algorithm.
         URI keyWrapAlgo = request.getKeyWrapAlgorithm();

         // create proof-of-possession token and server entropy (if needed).
         RequestedProofTokenType requestedProofToken = null;
         EntropyType serverEntropy = null;

         if (WSTrustConstants.KEY_TYPE_SYMMETRIC.equalsIgnoreCase(keyType.toString()))
         {
            // symmetric key case: if client entropy is found, compute a key. If not, generate a new key.
            requestedProofToken = new RequestedProofTokenType();
            ObjectFactory objFactory = new ObjectFactory();

            byte[] clientSecret = null;
            EntropyType clientEntropy = request.getEntropy();
            if (clientEntropy != null)
               clientSecret = WSTrustUtil.getBinarySecret(clientEntropy);

            byte[] serverSecret = WSTrustUtil.createRandomSecret((int) keySize / 8);
            BinarySecretType serverBinarySecret = new BinarySecretType();
            serverBinarySecret.setType(WSTrustConstants.BS_TYPE_NONCE);
            serverBinarySecret.setValue(serverSecret);
            serverEntropy = new EntropyType();
            serverEntropy.getAny().add(objFactory.createBinarySecret(serverBinarySecret));

            if (clientSecret != null && clientSecret.length != 0)
            {
               // client secret has been specified - combine it with the sts secret.
View Full Code Here

TOP

Related Classes of org.jboss.identity.federation.ws.trust.EntropyType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.