public void testSymKey() throws Exception {
ClassLoader tcl = Thread.currentThread().getContextClassLoader();
InputStream configStream = tcl.getResourceAsStream("parser/wst/wst-issue-symmetric-key.xml");
WSTrustParser parser = new WSTrustParser();
RequestSecurityToken requestToken = (RequestSecurityToken) parser.parse(configStream);
assertEquals("testcontext", requestToken.getContext());
assertEquals(WSTrustConstants.ISSUE_REQUEST, requestToken.getRequestType().toASCIIString());
AppliesTo appliesTo = requestToken.getAppliesTo();
EndpointReferenceType endpoint = (EndpointReferenceType) appliesTo.getAny().get(0);
assertEquals("http://services.testcorp.org/provider2", endpoint.getAddress().getValue());
assertEquals(WSTrustConstants.BS_TYPE_SYMMETRIC, requestToken.getKeyType().toASCIIString());
EntropyType entropy = requestToken.getEntropy();
BinarySecretType binarySecret = (BinarySecretType) entropy.getAny().get(0);
assertEquals(WSTrustConstants.BS_TYPE_NONCE, binarySecret.getType());
assertEquals("M0/7qLpV49c=", new String(binarySecret.getValue()));