本文整理汇总了Java中org.opensaml.saml2.binding.artifact.SAML2ArtifactType0004类的典型用法代码示例。如果您正苦于以下问题:Java SAML2ArtifactType0004类的具体用法?Java SAML2ArtifactType0004怎么用?Java SAML2ArtifactType0004使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SAML2ArtifactType0004类属于org.opensaml.saml2.binding.artifact包,在下文中一共展示了SAML2ArtifactType0004类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: buildArtifact
import org.opensaml.saml2.binding.artifact.SAML2ArtifactType0004; //导入依赖的package包/类
/**
*
* @param endPointIndex The endPointIndex to be used
* @param entityID The entityID of the Identity Provider
* @return An artifact for the given enitiyID
*/
public static SAML2ArtifactType0004 buildArtifact(int endPointIndex, String entityID) {
try {
byte[] endpointIndex = DatatypeHelper.intToByteArray(endPointIndex);
byte[] trimmedIndex = new byte[2];
trimmedIndex[0] = endpointIndex[2];
trimmedIndex[1] = endpointIndex[3];
MessageDigest sha1Digester = MessageDigest.getInstance(OIOSAMLConstants.SHA_HASH_ALGORHTM);
byte[] source = sha1Digester.digest(entityID.getBytes());
SecureRandom handleGenerator = SecureRandom.getInstance("SHA1PRNG");
byte[] assertionHandle;
assertionHandle = new byte[20];
handleGenerator.nextBytes(assertionHandle);
return new BRSArtifactType0004(trimmedIndex, source, assertionHandle);
} catch (NoSuchAlgorithmException e) {
throw new InternalError("JVM does not support required cryptography algorithms: SHA-1/SHA1PRNG.");
}
}
开发者ID:amagdenko,项目名称:oiosaml.java,代码行数:27,代码来源:BRSArtifact.java
示例2: getNewTicketId
import org.opensaml.saml2.binding.artifact.SAML2ArtifactType0004; //导入依赖的package包/类
/**
* {@inheritDoc}
* We ignore prefixes for SAML compliance.
*/
@Override
public String getNewTicketId(final String prefix) {
if (saml2compliant) {
return new SAML2ArtifactType0004(ENDPOINT_ID, newAssertionHandle(), sourceIdDigest).base64Encode();
} else {
return new SAML1ArtifactType0001(this.sourceIdDigest, newAssertionHandle()).base64Encode();
}
}
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:13,代码来源:SamlCompliantUniqueTicketIdGenerator.java
示例3: HTTPArtifactEncoder
import org.opensaml.saml2.binding.artifact.SAML2ArtifactType0004; //导入依赖的package包/类
/**
* Constructor.
*
* @param engine velocity engine used to construct the POST form
* @param template ID of velocity template used to construct the POST form
* @param map artifact map used to store artifact/message bindings
*/
public HTTPArtifactEncoder(VelocityEngine engine, String template, SAMLArtifactMap map) {
super();
postEncoding = false;
velocityEngine = engine;
velocityTemplateId = template;
artifactMap = map;
defaultArtifactType = SAML2ArtifactType0004.TYPE_CODE;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:HTTPArtifactEncoder.java
示例4: decodeArtifact
import org.opensaml.saml2.binding.artifact.SAML2ArtifactType0004; //导入依赖的package包/类
/**
* Decode the SAML artifact
* @param samlArt The base64 encoded SAML artifact
* @return The decoded SAML artifact
* @throws BindingException If the SAML artifact is not valid
*/
private SAML2ArtifactType0004 decodeArtifact(String samlArt) throws BindingException {
byte[] artifactBytes = Base64.decode(samlArt);
AbstractSAML2Artifact artifact = artifactFactory.buildArtifact(artifactBytes);
if (artifact instanceof SAML2ArtifactType0004) {
return (SAML2ArtifactType0004) artifact;
} else {
throw new BindingException("The artifact is not of the expected type: SAML2ArtifactType004");
}
}
开发者ID:amagdenko,项目名称:oiosaml.java,代码行数:16,代码来源:BRSArtifact.java
示例5: generateArtifact
import org.opensaml.saml2.binding.artifact.SAML2ArtifactType0004; //导入依赖的package包/类
private ByteArrayOutputStream generateArtifact() throws IOException,
NoSuchAlgorithmException, UnsupportedEncodingException {
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
bos.write(SAML2ArtifactType0004.TYPE_CODE);
bos.write(0);
bos.write(0);
MessageDigest md = MessageDigest.getInstance(OIOSAMLConstants.SHA_HASH_ALGORHTM);
bos.write(md.digest("idp1.test.oio.dk".getBytes("UTF-8")));
bos.write("12345678901234567890".getBytes());
return bos;
}
开发者ID:amagdenko,项目名称:oiosaml.java,代码行数:12,代码来源:SAMLAssertionConsumerHandlerTest.java
示例6: BRSArtifactType0004
import org.opensaml.saml2.binding.artifact.SAML2ArtifactType0004; //导入依赖的package包/类
public BRSArtifactType0004(byte[] endpointIndex, byte[] source, byte[] handle) {
super(endpointIndex, source, handle);
// OpenSAML forgets to set the TYPE_CODE, so we have to set it here
this.setTypeCode(SAML2ArtifactType0004.TYPE_CODE);
}
开发者ID:amagdenko,项目名称:oiosaml.java,代码行数:6,代码来源:BRSArtifactType0004.java
示例7: retrieveSourceId
import org.opensaml.saml2.binding.artifact.SAML2ArtifactType0004; //导入依赖的package包/类
private byte[] retrieveSourceId(String artifact) {
SAML2ArtifactBuilderFactory builder = new SAML2ArtifactBuilderFactory();
SAML2ArtifactType0004 art = (SAML2ArtifactType0004) builder.buildArtifact(artifact);
return art.getSourceID();
}
开发者ID:inbloom,项目名称:secure-data-service,代码行数:6,代码来源:SamlHelper.java
注:本文中的org.opensaml.saml2.binding.artifact.SAML2ArtifactType0004类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论