private void writeKeyValueType(KeyValueType type) throws ProcessingException { StaxUtil.writeStartElement(writer, WSTrustConstants.XMLDSig.DSIG_PREFIX, WSTrustConstants.XMLDSig.KEYVALUE, WSTrustConstants.DSIG_NS); StaxUtil.writeNameSpace(writer, WSTrustConstants.XMLDSig.DSIG_PREFIX, WSTrustConstants.DSIG_NS); if (type instanceof RSAKeyValueType) { RSAKeyValueType rsaKeyValue = (RSAKeyValueType) type; StaxWriterUtil.writeRSAKeyValueType(writer, rsaKeyValue); } else if (type instanceof DSAKeyValueType) { DSAKeyValueType dsaKeyValue = (DSAKeyValueType) type; StaxWriterUtil.writeDSAKeyValueType(writer, dsaKeyValue); } StaxUtil.writeEndElement(writer); }
/** * Write an {@code UseKeyType} to stream * * @param useKeyType * * @throws ProcessingException */ private void writeUseKeyType(UseKeyType useKeyType) throws ProcessingException { StaxUtil.writeStartElement(writer, PREFIX, WSTrustConstants.USE_KEY, BASE_NAMESPACE); List<Object> theList = useKeyType.getAny(); for (Object useKeyTypeValue : theList) { if (useKeyTypeValue instanceof Element) { Element domElement = (Element) useKeyTypeValue; StaxUtil.writeDOMElement(writer, domElement); } else if (useKeyTypeValue instanceof byte[]) { byte[] certificate = (byte[]) useKeyTypeValue; StaxUtil.writeStartElement(writer, WSTrustConstants.XMLDSig.DSIG_PREFIX, WSTrustConstants.XMLDSig.X509CERT, WSTrustConstants.DSIG_NS); StaxUtil.writeNameSpace(writer, WSTrustConstants.XMLDSig.DSIG_PREFIX, WSTrustConstants.DSIG_NS); StaxUtil.writeCharacters(writer, new String(certificate)); StaxUtil.writeEndElement(writer); } else if (useKeyTypeValue instanceof KeyValueType) { writeKeyValueType((KeyValueType) useKeyTypeValue); } else if (useKeyTypeValue instanceof KeyInfoType) { StaxWriterUtil.writeKeyInfo(writer, (KeyInfoType) useKeyTypeValue); } else throw logger.writerUnknownTypeError(useKeyTypeValue.getClass().getName()); } StaxUtil.writeEndElement(writer); }
/** * Write an {@code UseKeyType} to stream * * @param useKeyType * * @throws ProcessingException */ private void writeUseKeyType(UseKeyType useKeyType) throws ProcessingException { StaxUtil.writeStartElement(writer, PREFIX, WSTrustConstants.USE_KEY, BASE_NAMESPACE); List<Object> theList = useKeyType.getAny(); for (Object useKeyTypeValue : theList) { if (useKeyTypeValue instanceof Element) { Element domElement = (Element) useKeyTypeValue; StaxUtil.writeDOMElement(writer, domElement); } else if (useKeyTypeValue instanceof byte[]) { byte[] certificate = (byte[]) useKeyTypeValue; StaxUtil.writeStartElement(writer, WSTrustConstants.XMLDSig.DSIG_PREFIX, WSTrustConstants.XMLDSig.X509CERT, WSTrustConstants.DSIG_NS); StaxUtil.writeNameSpace(writer, WSTrustConstants.XMLDSig.DSIG_PREFIX, WSTrustConstants.DSIG_NS); StaxUtil.writeCharacters(writer, new String(certificate)); StaxUtil.writeEndElement(writer); } else if (useKeyTypeValue instanceof KeyValueType) { writeKeyValueType((KeyValueType) useKeyTypeValue); } else if (useKeyTypeValue instanceof KeyInfoType) { StaxWriterUtil.writeKeyInfo(writer, (KeyInfoType) useKeyTypeValue); } else throw logger.writerUnknownTypeError(useKeyTypeValue.getClass().getName()); } StaxUtil.writeEndElement(writer); }
private void writeKeyValueType(KeyValueType type) throws ProcessingException { StaxUtil.writeStartElement(writer, WSTrustConstants.XMLDSig.DSIG_PREFIX, WSTrustConstants.XMLDSig.KEYVALUE, WSTrustConstants.DSIG_NS); StaxUtil.writeNameSpace(writer, WSTrustConstants.XMLDSig.DSIG_PREFIX, WSTrustConstants.DSIG_NS); if (type instanceof RSAKeyValueType) { RSAKeyValueType rsaKeyValue = (RSAKeyValueType) type; StaxWriterUtil.writeRSAKeyValueType(writer, rsaKeyValue); } else if (type instanceof DSAKeyValueType) { DSAKeyValueType dsaKeyValue = (DSAKeyValueType) type; StaxWriterUtil.writeDSAKeyValueType(writer, dsaKeyValue); } StaxUtil.writeEndElement(writer); }
KeyInfoConfirmationDataType kicd = (KeyInfoConfirmationDataType) subjectConfirmationData; KeyInfoType keyInfo = (KeyInfoType) kicd.getAnyType(); StaxWriterUtil.writeKeyInfo(writer, keyInfo);
WSTrustConstants.XMLDSig.DSIG_NS); if (keyvalueType instanceof DSAKeyValueType) { writeDSAKeyValueType(writer, (DSAKeyValueType) keyvalueType); writeRSAKeyValueType(writer, (RSAKeyValueType) keyvalueType);
KeyInfoConfirmationDataType kicd = (KeyInfoConfirmationDataType) subjectConfirmationData; KeyInfoType keyInfo = (KeyInfoType) kicd.getAnyType(); StaxWriterUtil.writeKeyInfo(writer, keyInfo);
WSTrustConstants.XMLDSig.DSIG_NS); if (keyvalueType instanceof DSAKeyValueType) { writeDSAKeyValueType(writer, (DSAKeyValueType) keyvalueType); writeRSAKeyValueType(writer, (RSAKeyValueType) keyvalueType);