本文整理汇总了Java中org.opensaml.saml2.metadata.EntityDescriptor.setSignature方法的典型用法代码示例。如果您正苦于以下问题:Java EntityDescriptor.setSignature方法的具体用法?Java EntityDescriptor.setSignature怎么用?Java EntityDescriptor.setSignature使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opensaml.saml2.metadata.EntityDescriptor
的用法示例。
在下文中一共展示了EntityDescriptor.setSignature方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processChildElement
import org.opensaml.saml2.metadata.EntityDescriptor; //导入方法依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
throws UnmarshallingException {
EntityDescriptor entityDescriptor = (EntityDescriptor) parentSAMLObject;
if (childSAMLObject instanceof Extensions) {
entityDescriptor.setExtensions((Extensions) childSAMLObject);
} else if (childSAMLObject instanceof Signature) {
entityDescriptor.setSignature((Signature) childSAMLObject);
} else if (childSAMLObject instanceof RoleDescriptor) {
entityDescriptor.getRoleDescriptors().add((RoleDescriptor) childSAMLObject);
} else if (childSAMLObject instanceof AffiliationDescriptor) {
entityDescriptor.setAffiliationDescriptor((AffiliationDescriptor) childSAMLObject);
} else if (childSAMLObject instanceof Organization) {
entityDescriptor.setOrganization((Organization) childSAMLObject);
} else if (childSAMLObject instanceof ContactPerson) {
entityDescriptor.getContactPersons().add((ContactPerson) childSAMLObject);
} else if (childSAMLObject instanceof AdditionalMetadataLocation) {
entityDescriptor.getAdditionalMetadataLocations().add((AdditionalMetadataLocation) childSAMLObject);
} else {
super.processChildElement(parentSAMLObject, childSAMLObject);
}
}
示例2: processChildElement
import org.opensaml.saml2.metadata.EntityDescriptor; //导入方法依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
throws UnmarshallingException {
EntityDescriptor entityDescriptor = (EntityDescriptor) parentSAMLObject;
if (childSAMLObject instanceof Extensions) {
entityDescriptor.setExtensions((Extensions) childSAMLObject);
} else if (childSAMLObject instanceof Signature) {
entityDescriptor.setSignature((Signature) childSAMLObject);
} else if (childSAMLObject instanceof RoleDescriptor) {
entityDescriptor.getRoleDescriptors().add((RoleDescriptor) childSAMLObject);
} else if (childSAMLObject instanceof AffiliationDescriptor) {
entityDescriptor.setAffiliationDescriptor((AffiliationDescriptor) childSAMLObject);
} else if (childSAMLObject instanceof Organization) {
entityDescriptor.setOrganization((Organization) childSAMLObject);
} else if (childSAMLObject instanceof ContactPerson) {
entityDescriptor.getContactPersons().add((ContactPerson) childSAMLObject);
} else if (childSAMLObject instanceof AdditionalMetadataLocation) {
entityDescriptor.getAdditionalMetadataLocations().add((AdditionalMetadataLocation) childSAMLObject);
} else {
super.processChildElement(parentSAMLObject, childSAMLObject);
}
}
示例3: testChildElementsMarshall
import org.opensaml.saml2.metadata.EntityDescriptor; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void testChildElementsMarshall() {
QName qname = new QName(SAMLConstants.SAML20MD_NS, EntityDescriptor.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
EntityDescriptor descriptor = (EntityDescriptor) buildXMLObject(qname);
descriptor.setID(expectedID);
descriptor.setEntityID(expectedEntityID);
QName extensionsQName = new QName(SAMLConstants.SAML20MD_NS, Extensions.LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
descriptor.setExtensions((Extensions) buildXMLObject(extensionsQName));
descriptor.setSignature( buildSignatureSkeleton() );
QName idpSSOQName = new QName(SAMLConstants.SAML20MD_NS, IDPSSODescriptor.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
QName spSSOQName = new QName(SAMLConstants.SAML20MD_NS, SPSSODescriptor.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
QName authnAuthQName = new QName(SAMLConstants.SAML20MD_NS, AuthnAuthorityDescriptor.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
QName pdpQName = new QName(SAMLConstants.SAML20MD_NS, PDPDescriptor.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
QName affilQName = new QName(SAMLConstants.SAML20MD_NS, AffiliationDescriptor.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
descriptor.getRoleDescriptors(IDPSSODescriptor.DEFAULT_ELEMENT_NAME).add((IDPSSODescriptor) buildXMLObject(idpSSOQName));
descriptor.getRoleDescriptors(SPSSODescriptor.DEFAULT_ELEMENT_NAME).add((SPSSODescriptor) buildXMLObject(spSSOQName));
descriptor.getRoleDescriptors(SPSSODescriptor.DEFAULT_ELEMENT_NAME).add((SPSSODescriptor) buildXMLObject(spSSOQName));
descriptor.getRoleDescriptors(AuthnAuthorityDescriptor.DEFAULT_ELEMENT_NAME).add((AuthnAuthorityDescriptor) buildXMLObject(authnAuthQName));
descriptor.getRoleDescriptors(PDPDescriptor.DEFAULT_ELEMENT_NAME).add((PDPDescriptor) buildXMLObject(pdpQName));
descriptor.getRoleDescriptors(IDPSSODescriptor.DEFAULT_ELEMENT_NAME).add((IDPSSODescriptor) buildXMLObject(idpSSOQName));
descriptor.getRoleDescriptors(AttributeAuthorityDescriptor.DEFAULT_ELEMENT_NAME).add((AttributeAuthorityDescriptor) buildXMLObject(AttributeAuthorityDescriptor.DEFAULT_ELEMENT_NAME));
descriptor.getRoleDescriptors(SPSSODescriptor.DEFAULT_ELEMENT_NAME).add((SPSSODescriptor) buildXMLObject(spSSOQName));
descriptor.getRoleDescriptors(AuthnAuthorityDescriptor.DEFAULT_ELEMENT_NAME).add((AuthnAuthorityDescriptor) buildXMLObject(authnAuthQName));
descriptor.getRoleDescriptors(PDPDescriptor.DEFAULT_ELEMENT_NAME).add((PDPDescriptor) buildXMLObject(pdpQName));
descriptor.setAffiliationDescriptor((AffiliationDescriptor) buildXMLObject(affilQName));
QName orgQName = new QName(SAMLConstants.SAML20MD_NS, Organization.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
descriptor.setOrganization((Organization) buildXMLObject(orgQName));
QName contactQName = new QName(SAMLConstants.SAML20MD_NS, ContactPerson.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
descriptor.getContactPersons().add((ContactPerson) buildXMLObject(contactQName));
QName addMDQName = new QName(SAMLConstants.SAML20MD_NS, AdditionalMetadataLocation.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
for (int i = 0; i < 3; i++) {
descriptor.getAdditionalMetadataLocations().add((AdditionalMetadataLocation) buildXMLObject(addMDQName));
}
assertEquals(expectedChildElementsDOM, descriptor);
}