/** * Get a SecretKey from a SAML Assertion */ private byte[] getSecretKeyFromAssertion( AssertionWrapper assertion, SecurityTokenReference secRef, RequestData data, WSDocInfo wsDocInfo, boolean bspCompliant ) throws WSSecurityException { if (bspCompliant) { BSPEnforcer.checkSamlTokenBSPCompliance(secRef, assertion); } SAMLKeyInfo samlKi = SAMLUtil.getCredentialFromSubject(assertion, data, wsDocInfo, bspCompliant); if (samlKi == null) { throw new WSSecurityException( WSSecurityException.FAILED_CHECK, "invalidSAMLToken", new Object[] {"No Secret Key"} ); } return samlKi.getSecret(); }
/** * Get a SecretKey from a SAML Assertion */ private byte[] getSecretKeyFromAssertion( AssertionWrapper assertion, SecurityTokenReference secRef, RequestData data, WSDocInfo wsDocInfo, boolean bspCompliant ) throws WSSecurityException { if (bspCompliant) { BSPEnforcer.checkSamlTokenBSPCompliance(secRef, assertion); } SAMLKeyInfo samlKi = SAMLUtil.getCredentialFromSubject(assertion, data, wsDocInfo, bspCompliant); if (samlKi == null) { throw new WSSecurityException( WSSecurityException.FAILED_CHECK, "invalidSAMLToken", new Object[] {"No Secret Key"} ); } return samlKi.getSecret(); }
@Override public byte[] getAssertionKeyInfoSecret(Crypto signatureCrypto, TokenCallbackHandler tokenCallbackHandler) throws WSSecurityException { RequestData requestData = new RequestData(); requestData.setCallbackHandler(tokenCallbackHandler); requestData.setSigCrypto(signatureCrypto); WSDocInfo docInfo = new WSDocInfo(assertion.getDOM().getOwnerDocument()); // TODO Improve .. // TODO change this to use SAMLAssertion parameter once wss4j conversion is done .... SAMLKeyInfo samlKi = SAMLUtil.getCredentialFromSubject(assertion, requestData, docInfo, true); return samlKi.getSecret(); }
secretKey = keyInfo.getSecret(); } else { throw new WSSecurityException(
secretKey = keyInfo.getSecret(); } else { throw new WSSecurityException(
certs = new X509Certificate[]{foundCerts[0]}; secretKey = keyInfo.getSecret(); principal = createPrincipalFromSAML(assertion); } else if (el.equals(WSSecurityEngine.ENCRYPTED_KEY)) {
certs = new X509Certificate[]{foundCerts[0]}; secretKey = keyInfo.getSecret(); principal = createPrincipalFromSAML(assertion); } else if (el.equals(WSSecurityEngine.ENCRYPTED_KEY)) {
certs = new X509Certificate[]{foundCerts[0]}; secretKey = samlKi.getSecret(); publicKey = samlKi.getPublicKey(); principal = createPrincipalFromSAML(assertion);
certs = new X509Certificate[]{foundCerts[0]}; secretKey = samlKi.getSecret(); publicKey = samlKi.getPublicKey(); principal = createPrincipalFromSAML(assertion);
certs = new X509Certificate[]{foundCerts[0]}; secretKey = keyInfo.getSecret(); publicKey = keyInfo.getPublicKey(); principal = createPrincipalFromSAML(assertion);
certs = new X509Certificate[]{foundCerts[0]}; secretKey = keyInfo.getSecret(); publicKey = keyInfo.getPublicKey(); principal = createPrincipalFromSAML(assertion);