KeyInfoFactory.java revision 9d406c6b25ce9f6bf266b077443e723b95962914
/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions Copyrighted [year] [name of copyright owner]".
*
* Copyright 2014 ForgeRock AS. All rights reserved.
*/
/**
* This class provides methods to generate santuario KeyInfo instances corresponding to symmetric and public keys.
* TODO: all this needs to be tested and validated. Also look at SAML2Token.createKeyInfo. This class is currently
* not used, and was intended for use in creating the KeyInfo elements associated with HoK subject confirmations. Issuing
* HoK assertions will happen in the next sprint, and these issues, and the fate of this class, will be resolved.
*/
public class KeyInfoFactory {
/*
Passed to XMLUtils.getSafeDocumentBuilder to get a non-validating parser
*/
private static final boolean NON_VALIDATING_PARSER = false;
public KeyInfo generateSymmetricKeyInfo(
byte[] secret,
int keyIdentifierType,
);
);
}
public KeyInfo generatePublicKeyInfo(X509Certificate recipientCert) throws ParserConfigurationException, XMLSecurityException {
X509Data x509Data = new X509Data(XMLUtils.getSafeDocumentBuilder(NON_VALIDATING_PARSER).newDocument());
KeyInfo keyInfo = new KeyInfo(XMLUtils.getSafeDocumentBuilder(NON_VALIDATING_PARSER).newDocument());
return keyInfo;
}
}