protected KeyDescriptor getKeyDescriptor(UsageType type, KeyInfo key) { @SuppressWarnings("unchecked") SAMLObjectBuilder<KeyDescriptor> builder = (SAMLObjectBuilder<KeyDescriptor>) Configuration.getBuilderFactory() .getBuilder(KeyDescriptor.DEFAULT_ELEMENT_NAME); KeyDescriptor descriptor = builder.buildObject(); descriptor.setUse(type); descriptor.setKeyInfo(key); return descriptor; }
signKeyDescriptor.setKeyInfo(keyInfoGenerator.generate(signingCredential)); encKeyDescriptor.setKeyInfo(keyInfoGenerator.generate(encryptionCredential)); spSSODescriptor.getKeyDescriptors().add(signKeyDescriptor); spSSODescriptor.getKeyDescriptors().add(encKeyDescriptor);
/** {@inheritDoc} */ protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject) throws UnmarshallingException { KeyDescriptor keyDescriptor = (KeyDescriptor) parentSAMLObject; if (childSAMLObject instanceof KeyInfo) { keyDescriptor.setKeyInfo((KeyInfo) childSAMLObject); } else if (childSAMLObject instanceof EncryptionMethod) { keyDescriptor.getEncryptionMethods().add((EncryptionMethod) childSAMLObject); } else { super.processChildElement(parentSAMLObject, childSAMLObject); } }
/** * Creates the key descriptor element with new key info each time called. * * @return KeyDescriptor with a new KeyInfo element. * @throws MetadataException */ private KeyDescriptor createKeyDescriptor() throws MetadataException { if (log.isDebugEnabled()) { log.debug("Creating the KeyDescriptor element"); } KeyDescriptor keyDescriptor = BuilderUtil.createSAMLObject(ConfigElements.FED_METADATA_NS, "KeyDescriptor", ""); keyDescriptor.setUse(UsageType.SIGNING); keyDescriptor.setKeyInfo(createKeyInfo()); return keyDescriptor; }
protected KeyDescriptor getKeyDescriptor(UsageType type, KeyInfo key) { SAMLObjectBuilder<KeyDescriptor> builder = (SAMLObjectBuilder<KeyDescriptor>) Configuration.getBuilderFactory().getBuilder(KeyDescriptor.DEFAULT_ELEMENT_NAME); KeyDescriptor descriptor = builder.buildObject(); descriptor.setUse(type); descriptor.setKeyInfo(key); return descriptor; }
encKeyDescriptor.setUse(UsageType.SIGNING); encKeyDescriptor.setKeyInfo(keyInfoGenerator.generate(credential));
KeyDescriptor keyDescriptor = Saml2Util.buildXMLObject( KeyDescriptor.class, KeyDescriptor.DEFAULT_ELEMENT_NAME); keyDescriptor.setKeyInfo(getKeyInfo(identity)); keyDescriptor.setUse(UsageType.SIGNING); idpssoDescriptor.getKeyDescriptors().add(keyDescriptor);