當前位置: 首頁>>代碼示例>>Java>>正文


Java EncryptionConstants類代碼示例

本文整理匯總了Java中org.opensaml.xmlsec.encryption.support.EncryptionConstants的典型用法代碼示例。如果您正苦於以下問題:Java EncryptionConstants類的具體用法?Java EncryptionConstants怎麽用?Java EncryptionConstants使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


EncryptionConstants類屬於org.opensaml.xmlsec.encryption.support包,在下文中一共展示了EncryptionConstants類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getKeyEncryptionParameters

import org.opensaml.xmlsec.encryption.support.EncryptionConstants; //導入依賴的package包/類
/**
 * Gets key encryption parameters.
 *
 * @param samlObject the saml object
 * @param service    the service
 * @param adaptor    the adaptor
 * @param credential the credential
 * @return the key encryption parameters
 */
protected KeyEncryptionParameters getKeyEncryptionParameters(final Assertion samlObject, final SamlRegisteredService service,
                                                             final SamlRegisteredServiceServiceProviderMetadataFacade adaptor,
                                                             final Credential credential) {
    final KeyEncryptionParameters keyEncParams = new KeyEncryptionParameters();
    keyEncParams.setRecipient(adaptor.getEntityId());
    keyEncParams.setEncryptionCredential(credential);
    keyEncParams.setAlgorithm(EncryptionConstants.ALGO_ID_KEYTRANSPORT_RSAOAEP);
    return keyEncParams;
}
 
開發者ID:mrluo735,項目名稱:cas-5.1.0,代碼行數:19,代碼來源:SamlObjectEncrypter.java

示例2: createAuthnResponseSignedByKeyPair

import org.opensaml.xmlsec.encryption.support.EncryptionConstants; //導入依賴的package包/類
private static SamlAuthnResponseContainerDto createAuthnResponseSignedByKeyPair(SessionId sessionId, String publicKey, String privateKey) throws Exception {
    AuthnResponseFactory authnResponseFactory = AuthnResponseFactory.anAuthnResponseFactory();
    String samlResponse = authnResponseFactory.aSamlResponseFromCountry("a-request",
        COUNTRY_ENTITY_ID,
        publicKey,
        privateKey,
        DESTINATION,
        SIGNATURE_ALGORITHM,
        DIGEST_ALGORITHM,
        EncryptionConstants.ALGO_ID_BLOCKCIPHER_AES256_GCM,
        EidasAuthnContext.EIDAS_LOA_SUBSTANTIAL,
        DESTINATION,
        COUNTRY_ENTITY_ID);
    return new SamlAuthnResponseContainerDto(samlResponse, sessionId, "127.0.0.1");
}
 
開發者ID:alphagov,項目名稱:verify-hub,代碼行數:16,代碼來源:EidasSessionResourceContractTest.java

示例3: getAES256WithGCMAssertionDecrypter

import org.opensaml.xmlsec.encryption.support.EncryptionConstants; //導入依賴的package包/類
@Provides
@Named("AES256DecrypterWithGCM")
private AssertionDecrypter getAES256WithGCMAssertionDecrypter(IdaKeyStore keyStore) {
    return new AssertionDecrypter(
            new IdaKeyStoreCredentialRetriever(keyStore), new EncryptionAlgorithmValidator(ImmutableSet.of(EncryptionConstants.ALGO_ID_BLOCKCIPHER_AES256, EncryptionConstants.ALGO_ID_BLOCKCIPHER_AES256_GCM)), new DecrypterFactory()
    );
}
 
開發者ID:alphagov,項目名稱:verify-hub,代碼行數:8,代碼來源:SamlEngineModule.java

示例4: decryptAssertions

import org.opensaml.xmlsec.encryption.support.EncryptionConstants; //導入依賴的package包/類
public List<Assertion> decryptAssertions(Response response) {
    KeyPair encryptionKeyPair = new KeyPair(publicKey, privateKey);
    KeyPair signingKeyPair = new KeyPair(publicKey, privateKey);
    IdaKeyStore keyStore = new IdaKeyStore(signingKeyPair, Collections.singletonList(encryptionKeyPair));
    uk.gov.ida.saml.security.AssertionDecrypter assertionDecrypter = new uk.gov.ida.saml.security.AssertionDecrypter(
            new IdaKeyStoreCredentialRetriever(keyStore), new EncryptionAlgorithmValidator(ImmutableSet.of(EncryptionConstants.ALGO_ID_BLOCKCIPHER_AES256_GCM)), new DecrypterFactory()
    );
    return assertionDecrypter.decryptAssertions(new ValidatedResponse(response));
}
 
開發者ID:alphagov,項目名稱:verify-hub,代碼行數:10,代碼來源:AssertionDecrypter.java

示例5: createAuthnResponseSignedByKeyPair

import org.opensaml.xmlsec.encryption.support.EncryptionConstants; //導入依賴的package包/類
private SamlAuthnResponseTranslatorDto createAuthnResponseSignedByKeyPair(String publicKey, String privateKey) throws Exception {
    SessionId sessionId = SessionId.createNewSessionId();
    String samlResponse = authnResponseFactory.aSamlResponseFromCountry("a-request",
        samlEngineAppRule.getCountryMetadataUri(),
        publicKey,
        privateKey,
        DESTINATION,
        SIGNATURE_ALGORITHM,
        DIGEST_ALGORITHM,
        EncryptionConstants.ALGO_ID_BLOCKCIPHER_AES256_GCM,
        EidasAuthnContext.EIDAS_LOA_SUBSTANTIAL,
        DESTINATION,
        samlEngineAppRule.getCountryMetadataUri());
    return new SamlAuthnResponseTranslatorDto(samlResponse, sessionId, "127.0.0.1", matchingServiceEntityId);
}
 
開發者ID:alphagov,項目名稱:verify-hub,代碼行數:16,代碼來源:CountryAuthnResponseTranslatorResourceTest.java

示例6: getDataEncryptionParameters

import org.opensaml.xmlsec.encryption.support.EncryptionConstants; //導入依賴的package包/類
/**
 * Gets data encryption parameters.
 *
 * @param samlObject the saml object
 * @param service    the service
 * @param adaptor    the adaptor
 * @return the data encryption parameters
 */
protected DataEncryptionParameters getDataEncryptionParameters(final Assertion samlObject, final SamlRegisteredService service,
                                                               final SamlRegisteredServiceServiceProviderMetadataFacade adaptor) {
    final DataEncryptionParameters dataEncParams = new DataEncryptionParameters();
    dataEncParams.setAlgorithm(EncryptionConstants.ALGO_ID_BLOCKCIPHER_AES128);
    return dataEncParams;
}
 
開發者ID:mrluo735,項目名稱:cas-5.1.0,代碼行數:15,代碼來源:SamlObjectEncrypter.java


注:本文中的org.opensaml.xmlsec.encryption.support.EncryptionConstants類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。