• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SecureRandomIdentifierGenerator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: init

import org.opensaml.common.impl.SecureRandomIdentifierGenerator; //导入依赖的package包/类
/**
 * Helper method for constructors.
 */
private void init() {
    builderFactory = Configuration.getBuilderFactory();
    keyInfoBuilder = 
        (XMLSignatureBuilder<KeyInfo>) builderFactory.getBuilder(KeyInfo.DEFAULT_ELEMENT_NAME);
    dataReferenceBuilder = 
        (XMLEncryptionBuilder<DataReference>) builderFactory.getBuilder(DataReference.DEFAULT_ELEMENT_NAME);
    referenceListBuilder = 
        (XMLEncryptionBuilder<ReferenceList>) builderFactory.getBuilder(ReferenceList.DEFAULT_ELEMENT_NAME);
    retrievalMethodBuilder = 
        (XMLSignatureBuilder<RetrievalMethod>) builderFactory.getBuilder(RetrievalMethod.DEFAULT_ELEMENT_NAME);
    keyNameBuilder = 
        (XMLSignatureBuilder<KeyName>) builderFactory.getBuilder(KeyName.DEFAULT_ELEMENT_NAME);
    carriedKeyNameBuilder = 
        (XMLEncryptionBuilder<CarriedKeyName>) builderFactory.getBuilder(CarriedKeyName.DEFAULT_ELEMENT_NAME);
    
    try{
        idGenerator = new SecureRandomIdentifierGenerator();
    }catch(NoSuchAlgorithmException e){
        log.error("JVM does not support SHA1PRNG random number generation algorithm.");
    }
    
    keyPlacement = KeyPlacement.PEER;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:27,代码来源:Encrypter.java


示例2: setUp

import org.opensaml.common.impl.SecureRandomIdentifierGenerator; //导入依赖的package包/类
/** {@inheritDoc} */
protected void setUp() throws Exception {
    super.setUp();
    
    KeyPair keyPair = SecurityTestHelper.generateKeyPair("RSA", 1024, null);
    goodCredential = SecurityHelper.getSimpleCredential(keyPair.getPublic(), keyPair.getPrivate());
    
    keyPair = SecurityTestHelper.generateKeyPair("RSA", 1024, null);
    badCredential = SecurityHelper.getSimpleCredential(keyPair.getPublic(), null);
    
    assertionBuilder = (AssertionBuilder) builderFactory.getBuilder(Assertion.DEFAULT_ELEMENT_NAME);
    issuerBuilder = (IssuerBuilder) builderFactory.getBuilder(Issuer.DEFAULT_ELEMENT_NAME);
    authnStatementBuilder = (AuthnStatementBuilder) builderFactory.getBuilder(AuthnStatement.DEFAULT_ELEMENT_NAME);
    signatureBuilder = (SignatureBuilder) builderFactory.getBuilder(Signature.DEFAULT_ELEMENT_NAME);
    
    idGenerator = new SecureRandomIdentifierGenerator();
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:18,代码来源:SignedAssertionTest.java


示例3: AbstractSaml10ResponseView

import org.opensaml.common.impl.SecureRandomIdentifierGenerator; //导入依赖的package包/类
protected AbstractSaml10ResponseView() {
    try {
        this.idGenerator = new SecureRandomIdentifierGenerator();
    } catch (final NoSuchAlgorithmException e) {
        throw new IllegalStateException("Cannot create secure random ID generator for SAML message IDs.");
    }
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:8,代码来源:AbstractSaml10ResponseView.java


示例4: buildAssertion

import org.opensaml.common.impl.SecureRandomIdentifierGenerator; //导入依赖的package包/类
private Assertion buildAssertion() throws NoSuchAlgorithmException, IllegalAccessException, KeyStoreException, java.security.cert.CertificateException,
		SignatureException, MarshallingException, CertificateException, IOException, SecurityException, MetadataProviderException {
	SecureRandomIdentifierGenerator idGenerator = new SecureRandomIdentifierGenerator();

	Assertion assertion = buildXMLObjectDefaultName(Assertion.class);

	Issuer issuer = buildXMLObjectDefaultName(Issuer.class);
	issuer.setValue(MockIDPProperties.getIdpEntityId());
	assertion.setIssuer(issuer);
	assertion.setIssueInstant(new DateTime());

	assertion.setID(idGenerator.generateIdentifier());

	Subject subject = buildXMLObjectDefaultName(Subject.class);
	assertion.setSubject(subject);

	NameID nameID = buildXMLObjectDefaultName(NameID.class);
	nameID.setFormat(NameIDType.TRANSIENT);
	nameID.setValue("5VkzP/MZ1PMJ62o45/7DdFms9y7K");
	nameID.setSPNameQualifier("steras-openam");
	nameID.setNameQualifier("FakeIdP");

	subject.setNameID(nameID);

	subject.getSubjectConfirmations().add(buildSubjectConfirmation());

	assertion.setConditions(buildConditions());

	assertion.getAttributeStatements().add(buildAttributeStatement());

	assertion.getAuthnStatements().add(buildAuthnStatement());

	signSAMLObject(assertion, getIDPKeyFromKeystore());
	return assertion;
}
 
开发者ID:rasmusson,项目名称:MockIDP,代码行数:36,代码来源:MockIDPArtifactResolve.java


示例5: buildArtifactResponse

import org.opensaml.common.impl.SecureRandomIdentifierGenerator; //导入依赖的package包/类
private ArtifactResponse buildArtifactResponse() throws IllegalAccessException, NoSuchAlgorithmException, KeyStoreException,
		java.security.cert.CertificateException, CertificateException, IOException, SecurityException, EncryptionException, NoSuchProviderException,
		SignatureException, MarshallingException, MetadataProviderException {
	SecureRandomIdentifierGenerator idGenerator = new SecureRandomIdentifierGenerator();

	ArtifactResponse artifactResponse = buildXMLObjectDefaultName(ArtifactResponse.class);

	Issuer issuer = buildXMLObjectDefaultName(Issuer.class);
	issuer.setValue(MockIDPProperties.getIdpEntityId());
	artifactResponse.setIssuer(issuer);
	artifactResponse.setIssueInstant(new DateTime());
	artifactResponse.setDestination(MockIDPSPMetadata.getSpConsumerUrl());

	artifactResponse.setID(idGenerator.generateIdentifier());

	Status status = buildXMLObjectDefaultName(Status.class);
	StatusCode statusCode = buildXMLObjectDefaultName(StatusCode.class);
	statusCode.setValue(StatusCode.SUCCESS_URI);
	status.setStatusCode(statusCode);
	artifactResponse.setStatus(status);

	Response response = buildXMLObjectDefaultName(Response.class);
	response.setDestination(MockIDPSPMetadata.getSpConsumerUrl());
	response.setIssueInstant(new DateTime());
	response.setID(idGenerator.generateIdentifier());
	response.setInResponseTo(MockIDPAuthnReq.authnReqId);
	Issuer issuer2 = buildXMLObjectDefaultName(Issuer.class);
	issuer2.setValue(MockIDPProperties.getIdpEntityId());

	response.setIssuer(issuer2);

	Status status2 = buildXMLObjectDefaultName(Status.class);
	StatusCode statusCode2 = buildXMLObjectDefaultName(StatusCode.class);
	statusCode2.setValue(StatusCode.SUCCESS_URI);
	status2.setStatusCode(statusCode2);

	response.setStatus(status2);

	artifactResponse.setMessage(response);

	response.getEncryptedAssertions().add(encryptAssertion(buildAssertion()));
	return artifactResponse;
}
 
开发者ID:rasmusson,项目名称:MockIDP,代码行数:44,代码来源:MockIDPArtifactResolve.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FSM类代码示例发布时间:2022-05-22
下一篇:
Java AbstractJavaClientGenerator类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap