本文整理汇总了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;
}
示例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");
}
示例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()
);
}
示例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));
}
示例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);
}
示例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;
}