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


Java SecureRandomIdentifierGenerator类代码示例

本文整理汇总了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;未经允许,请勿转载。