Package org.opensaml.xml.signature

Examples of org.opensaml.xml.signature.DEREncodedKeyValue


*/
public class DEREncodedKeyValueUnmarshaller extends XSBase64BinaryUnmarshaller {

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
        DEREncodedKeyValue der = (DEREncodedKeyValue) xmlObject;

        if (attribute.getLocalName().equals(DEREncodedKeyValue.ID_ATTRIB_NAME)) {
            der.setID(attribute.getValue());
            attribute.getOwnerElement().setIdAttributeNode(attribute, true);
        } else {
            super.processAttribute(xmlObject, attribute);
        }
    }
View Full Code Here


*/
public class DEREncodedKeyValueMarshaller extends XSBase64BinaryMarshaller {

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
        DEREncodedKeyValue der = (DEREncodedKeyValue) xmlObject;

        if (der.getID() != null) {
            domElement.setAttributeNS(null, DEREncodedKeyValue.ID_ATTRIB_NAME, der.getID());
            domElement.setIdAttributeNS(null, DEREncodedKeyValue.ID_ATTRIB_NAME, true);
        }
    }
View Full Code Here

    /** {@inheritDoc} */
    public Collection<Credential> process(KeyInfoCredentialResolver resolver, XMLObject keyInfoChild,
            CriteriaSet criteriaSet, KeyInfoResolutionContext kiContext) throws SecurityException {

        DEREncodedKeyValue keyValue = getDEREncodedKeyValue(keyInfoChild);
        if (keyValue == null) {
            return null;
        }

        log.debug("Attempting to extract credential from a DEREncodedKeyValue");
View Full Code Here

     * @throws NoSuchAlgorithmException if the key type is unsupported
     * @throws InvalidKeySpecException if the key type does not support X.509 SPKI encoding
     */
    public static void addDEREncodedPublicKey(KeyInfo keyInfo, PublicKey pk)
            throws NoSuchAlgorithmException, InvalidKeySpecException {
        DEREncodedKeyValue keyValue = (DEREncodedKeyValue) Configuration.getBuilderFactory()
            .getBuilder(DEREncodedKeyValue.DEFAULT_ELEMENT_NAME)
            .buildObject(DEREncodedKeyValue.DEFAULT_ELEMENT_NAME);
       
        KeyFactory keyFactory = KeyFactory.getInstance(pk.getAlgorithm());
        X509EncodedKeySpec keySpec = keyFactory.getKeySpec(pk, X509EncodedKeySpec.class);
        keyValue.setValue(Base64.encodeBytes(keySpec.getEncoded()));
        keyInfo.getXMLObjects().add(keyValue);
    }   
View Full Code Here

TOP

Related Classes of org.opensaml.xml.signature.DEREncodedKeyValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.