本文整理汇总了Java中javax.xml.crypto.dsig.keyinfo.PGPData类的典型用法代码示例。如果您正苦于以下问题:Java PGPData类的具体用法?Java PGPData怎么用?Java PGPData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PGPData类属于javax.xml.crypto.dsig.keyinfo包,在下文中一共展示了PGPData类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: marshalPGPData
import javax.xml.crypto.dsig.keyinfo.PGPData; //导入依赖的package包/类
/**
* Marshals a {@link PGPData}
*
* @param xwriter
* @param pgpData
* @param dsPrefix
* @param context
* @throws MarshalException
*/
public static void marshalPGPData(XmlWriter xwriter, PGPData pgpData, String dsPrefix, XMLCryptoContext context)
throws MarshalException {
xwriter.writeStartElement(dsPrefix, "PGPData", XMLSignature.XMLNS);
// create and append PGPKeyID element
byte[] keyId = pgpData.getKeyId();
if (keyId != null) {
xwriter.writeTextElement(dsPrefix, "PGPKeyID", XMLSignature.XMLNS, Base64.encode(keyId));
}
// create and append PGPKeyPacket element
byte[] keyPacket = pgpData.getKeyPacket();
if (keyPacket != null) {
xwriter.writeTextElement(dsPrefix, "XMLSignature.XMLNS", XMLSignature.XMLNS, Base64.encode(keyPacket));
}
// create and append any elements
@SuppressWarnings("unchecked")
List<XMLStructure> externalElements = pgpData.getExternalElements();
for (XMLStructure externalItem : externalElements) {
xwriter.marshalStructure(externalItem, dsPrefix, context);
}
xwriter.writeEndElement(); // "PGPData"
}
示例2: marshalObject
import javax.xml.crypto.dsig.keyinfo.PGPData; //导入依赖的package包/类
@Override
public void marshalObject(XmlWriter xwriter, PGPData toMarshal, String dsPrefix,
XMLCryptoContext context) throws MarshalException {
Marshaller.marshalPGPData( xwriter, toMarshal, dsPrefix, context);
}