当前位置: 首页>>代码示例>>Java>>正文


Java DecrypterFactory类代码示例

本文整理汇总了Java中uk.gov.ida.saml.security.DecrypterFactory的典型用法代码示例。如果您正苦于以下问题:Java DecrypterFactory类的具体用法?Java DecrypterFactory怎么用?Java DecrypterFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DecrypterFactory类属于uk.gov.ida.saml.security包,在下文中一共展示了DecrypterFactory类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUp

import uk.gov.ida.saml.security.DecrypterFactory; //导入依赖的package包/类
@Before
public void setUp() {
    IdaSamlBootstrap.bootstrap();
    reset(manifestReader);

    final BasicCredential basicCredential = createBasicCredential();
    encrypter = new uk.gov.ida.saml.security.EncrypterFactory().createEncrypter(basicCredential);
    decrypter = new DecrypterFactory().createDecrypter(ImmutableList.of(basicCredential));
    when(encrypterFactory.createEncrypter()).thenReturn(encrypter);
    factory = new AuthnRequestFactory(
        DESTINATION,
        new PrivateKeyStoreFactory().create(TestEntityIds.TEST_RP).getSigningPrivateKey(),
        manifestReader,
        encrypterFactory
    );
}
 
开发者ID:alphagov,项目名称:verify-service-provider,代码行数:17,代码来源:AuthnRequestFactoryTest.java

示例2: getVerifyAttributeQueryToInboundMatchingServiceRequestTransformer

import uk.gov.ida.saml.security.DecrypterFactory; //导入依赖的package包/类
public VerifyAttributeQueryToInboundMatchingServiceRequestTransformer getVerifyAttributeQueryToInboundMatchingServiceRequestTransformer(
    final MetadataResolver metaDataResolver,
    final IdaKeyStore keyStore,
    final MatchingServiceAdapterConfiguration matchingServiceAdapterConfiguration,
    final String hubEntityId,
    CertificateChainEvaluableCriterion certificateChainEvaluableCriterion) throws ComponentInitializationException {
    HubAssertionUnmarshaller hubAssertionTransformer = coreTransformersFactory.getAssertionToHubAssertionTransformer(hubEntityId);
    IdentityProviderAssertionUnmarshaller identityProviderAssertionTransformer = new IdentityProviderAssertionUnmarshaller(
            new MatchingDatasetUnmarshaller(new AddressFactory()),
            new IdentityProviderAuthnStatementUnmarshaller(new AuthnContextFactory()),
            hubEntityId
    );
    SignatureValidator signatureValidator = getMetadataBackedSignatureValidator(metaDataResolver, certificateChainEvaluableCriterion);
    return new VerifyAttributeQueryToInboundMatchingServiceRequestTransformer(
            new SamlAttributeQueryValidator(),
            new AttributeQuerySignatureValidator(new SamlMessageSignatureValidator(signatureValidator)),
            new SamlAssertionsSignatureValidator(new SamlMessageSignatureValidator(signatureValidator)),
            new InboundMatchingServiceRequestUnmarshaller(hubAssertionTransformer, identityProviderAssertionTransformer),
            new SamlAttributeQueryAssertionsValidator(getAssertionValidator(), getIdentityProviderAssertionValidator(), matchingServiceAdapterConfiguration, hubEntityId),
            new AssertionDecrypter(new IdaKeyStoreCredentialRetriever(keyStore), new EncryptionAlgorithmValidator(), new DecrypterFactory()),
            hubEntityId);
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:23,代码来源:MsaTransformersFactory.java

示例3: setup

import uk.gov.ida.saml.security.DecrypterFactory; //导入依赖的package包/类
@Before
public void setup() throws Exception {
    PublicKeyFactory publicKeyFactory = new PublicKeyFactory(new X509CertificateFactory());
    PrivateKey privateKey = new PrivateKeyFactory().createPrivateKey(Base64.decodeBase64(TestCertificateStrings.PRIVATE_SIGNING_KEYS.get(HUB_ENTITY_ID)));
    PublicKey publicKey = publicKeyFactory.createPublicKey(TestCertificateStrings.getPrimaryPublicEncryptionCert(HUB_ENTITY_ID));

    PrivateKey privateEncryptionKey = new PrivateKeyFactory().createPrivateKey(Base64.decodeBase64(TestCertificateStrings.HUB_TEST_PRIVATE_ENCRYPTION_KEY));
    PublicKey publicEncryptionKey = publicKeyFactory.createPublicKey(TestCertificateStrings.HUB_TEST_PUBLIC_ENCRYPTION_CERT);

    KeyPair encryptionKeyPair = new KeyPair(publicEncryptionKey, privateEncryptionKey);

    KeyPair signingKeyPair = new KeyPair(publicKey, privateKey);
    IdaKeyStore keyStore = new IdaKeyStore(signingKeyPair, Collections.singletonList(encryptionKeyPair));

    assertionDecrypter = new AssertionDecrypter(new IdaKeyStoreCredentialRetriever(
            keyStore),
            new EncryptionAlgorithmValidator(),
            new DecrypterFactory());
    setUpMatchingService();
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:21,代码来源:UserAccountCreationAppRuleTest.java

示例4: getAES256WithGCMAssertionDecrypter

import uk.gov.ida.saml.security.DecrypterFactory; //导入依赖的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

示例5: decryptAssertions

import uk.gov.ida.saml.security.DecrypterFactory; //导入依赖的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

示例6: decrypt

import uk.gov.ida.saml.security.DecrypterFactory; //导入依赖的package包/类
private Assertion decrypt(EncryptedAssertion encryptedAssertion) {
    Decrypter decrypter = new DecrypterFactory().createDecrypter(ImmutableList.of(new BasicCredential(publicKey, privateKey)));
    decrypter.setRootInNewDocument(true);
    try {
        return decrypter.decrypt(encryptedAssertion);
    } catch (DecryptionException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:alphagov,项目名称:verify-hub,代码行数:10,代码来源:AssertionDecrypter.java

示例7: getAssertionDecrypter

import uk.gov.ida.saml.security.DecrypterFactory; //导入依赖的package包/类
@Provides
public AssertionDecrypter getAssertionDecrypter(IdaKeyStore eidasKeystore) {
    return new AssertionDecrypter(new IdaKeyStoreCredentialRetriever(eidasKeystore), new EncryptionAlgorithmValidator(), new DecrypterFactory());
}
 
开发者ID:alphagov,项目名称:verify-matching-service-adapter,代码行数:5,代码来源:MatchingServiceAdapterModule.java


注:本文中的uk.gov.ida.saml.security.DecrypterFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。