org.opensaml.xml.signature.Signature.getContentReferences()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(163)

本文整理了Java中org.opensaml.xml.signature.Signature.getContentReferences()方法的一些代码示例,展示了Signature.getContentReferences()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Signature.getContentReferences()方法的具体详情如下:
包路径:org.opensaml.xml.signature.Signature
类名称:Signature
方法名:getContentReferences

Signature.getContentReferences介绍

[英]Gets the list of signature content references.
[中]获取签名内容引用的列表。

代码示例

代码示例来源:origin: org.opensaml/opensaml

/**
 * {@inheritDoc}
 * 
 * When a signature is added, a default content reference that uses the ID of this object will be
 * created and added to the signature at the time of signing. See {@link SAMLObjectContentReference} 
 * for the default digest algorithm and transforms that will be used.  These default values may be 
 * changed prior to marshalling this object.
 */
public void setSignature(Signature newSignature) {
  if(newSignature != null){
    newSignature.getContentReferences().add(new SAMLObjectContentReference(this));
  }
  super.setSignature(newSignature);
}

代码示例来源:origin: org.apache.ws.security/wss4j

/**
 * Method setSignature sets the signature of this SamlAssertionWrapper object.
 *
 * @param signature the signature of this SamlAssertionWrapper object.
 * @param signatureDigestAlgorithm the signature digest algorithm to use
 */
public void setSignature(Signature signature, String signatureDigestAlgorithm) {
  if (xmlObject instanceof SignableSAMLObject) {
    SignableSAMLObject signableObject = (SignableSAMLObject) xmlObject;
    signableObject.setSignature(signature);
    String digestAlg = signatureDigestAlgorithm;
    if (digestAlg == null) {
      digestAlg = defaultSignatureDigestAlgorithm;
    }
    SAMLObjectContentReference contentRef = 
      (SAMLObjectContentReference)signature.getContentReferences().get(0);
    contentRef.setDigestAlgorithm(digestAlg);
    signableObject.releaseDOM();
    signableObject.releaseChildrenDOM(true);
  } else {
    LOG.error("Attempt to sign an unsignable object " + xmlObject.getClass().getName());
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.wss4j

/**
 * Method setSignature sets the signature of this SamlAssertionWrapper object.
 *
 * @param signature the signature of this SamlAssertionWrapper object.
 * @param signatureDigestAlgorithm the signature digest algorithm to use
 */
public void setSignature(Signature signature, String signatureDigestAlgorithm) {
  if (xmlObject instanceof SignableSAMLObject) {
    SignableSAMLObject signableObject = (SignableSAMLObject) xmlObject;
    signableObject.setSignature(signature);
    String digestAlg = signatureDigestAlgorithm;
    if (digestAlg == null) {
      digestAlg = defaultSignatureDigestAlgorithm;
    }
    SAMLObjectContentReference contentRef = 
      (SAMLObjectContentReference)signature.getContentReferences().get(0);
    contentRef.setDigestAlgorithm(digestAlg);
    signableObject.releaseDOM();
    signableObject.releaseChildrenDOM(true);
  } else {
    LOG.error("Attempt to sign an unsignable object " + xmlObject.getClass().getName());
  }
}

代码示例来源:origin: org.opensaml/opensaml

log.debug("Examing signed object for content references with exclusive canonicalization transform");
boolean sawExclusive = false;
for (ContentReference cr : signableObject.getSignature().getContentReferences()) {
  if (cr instanceof SAMLObjectContentReference) {
    List<String> transforms = ((SAMLObjectContentReference)cr).getTransforms();

代码示例来源:origin: usnistgov/iheos-toolkit2

private static void extractSignatureInfo(Assertion assertion, AssertionType assertOut) {
  SamlSignatureType samlSignature = assertOut.getSamlSignature() ;
  SamlSignatureKeyInfoType samlSignatureKeyInfoType = samlSignature.getKeyInfo() ;
  byte []signatureValue = samlSignature.getSignatureValue();
  samlSignature.getKeyInfo().getRsaKeyValueExponent();
  samlSignature.getKeyInfo().getRsaKeyValueModulus() ;
  
  Signature signature = assertion.getSignature() ;
  assertion.getSignature().getCanonicalizationAlgorithm();
  signature.getSignatureAlgorithm();
  List<ContentReference> contentReference1 = signature.getContentReferences();
  
  ContentReference contentReference = (ContentReference)contentReference1.get(0);
  signature.getSigningCredential().getPublicKey().getAlgorithm();
  
  //signature.getSigningCredential().
  
  
}
private static String getSubjectNameIDValue(Assertion assertion) {

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.sso.saml

((SAMLObjectContentReference) signature.getContentReferences().get(0)).setDigestAlgorithm(digestAlgorithm);

代码示例来源:origin: org.wso2.carbon.identity.inbound.auth.saml.cloud/org.wso2.carbon.identity.sso.saml.cloud

((SAMLObjectContentReference) signature.getContentReferences().get(0)).setDigestAlgorithm(digestAlgorithm);

代码示例来源:origin: io.apigee.opensaml/xmltooling

for (ContentReference contentReference : signature.getContentReferences()) {
  contentReference.createReference(dsig);

代码示例来源:origin: org.opensaml/xmltooling

for (ContentReference contentReference : signature.getContentReferences()) {
  contentReference.createReference(dsig);

相关文章