当前位置: 首页>>代码示例>>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;未经允许,请勿转载。