class KeyInfoFactoryImpl implements KeyInfoFactory {

    @Override
    public Element generatePublicKeyInfo(X509Certificate recipientCert) throws ParserConfigurationException, XMLSecurityException {
        Document sharedDocument = xmlUtilities.newSafeDocument(XMLUtils.isValidating());
        KeyInfo keyInfo = new KeyInfo(sharedDocument);
        sharedDocument.appendChild(keyInfo.getElement());
        X509Data x509Data = new X509Data(sharedDocument);
        keyInfo.add(x509Data);
        x509Data.addCertificate(recipientCert);
        return keyInfo.getElement();
    }

    @Inject public  KeyInfoFactoryImpl(XMLUtilities xmlUtilities);

}