/** * Write a {@code BinarySecretType} to stream * @param writer * @param binarySecret * @throws ProcessingException */ private void writeBinarySecretType(XMLStreamWriter writer, BinarySecretType binarySecret) throws ProcessingException { StaxUtil.writeStartElement(writer, PREFIX, WSTrustConstants.BINARY_SECRET, BASE_NAMESPACE); String type = binarySecret.getType(); StaxUtil.writeAttribute(writer, WSTrustConstants.TYPE, type); StaxUtil.writeCharacters(writer, new String(binarySecret.getValue())); StaxUtil.writeEndElement(writer); }
if (StaxParserUtil.matches(subEvent, WSTrustConstants.BINARY_SECRET)) BinarySecretType binarySecret = new BinarySecretType(); Attribute typeAttribute = subEvent.getAttributeByName(new QName("", "Type")); binarySecret.setType(StaxParserUtil.getAttributeValue(typeAttribute)); binarySecret.setValue(StaxParserUtil.getElementText(xmlEventReader).getBytes()); entropy.addAny(binarySecret); if (StaxParserUtil.matches(subEvent, WSTrustConstants.BINARY_SECRET)) BinarySecretType binarySecret = new BinarySecretType(); Attribute typeAttribute = subEvent.getAttributeByName(new QName("", "Type")); binarySecret.setType(StaxParserUtil.getAttributeValue(typeAttribute)); binarySecret.setValue(StaxParserUtil.getElementText(xmlEventReader).getBytes()); requestedProofToken.add(binarySecret);
BinarySecretType serverBinarySecret = new BinarySecretType(); serverBinarySecret.setType(WSTrustConstants.BS_TYPE_NONCE); serverBinarySecret.setValue(Base64.encodeBytes(serverSecret).getBytes()); requestContext.setProofTokenInfo(WSTrustUtil.createKeyInfo(serverBinarySecret.getValue(), providerPublicKey, keyWrapAlgo));
/** * <p> * Parses the specified {@code EntropyType} and returns the first binary secret contained in the entropy. * </p> * * @param entropy a reference to the {@code EntropyType} that contains the binary secret. * @return a {@code byte[]} containing the secret; {@code null} if the specified entropy doesn't contain any secret. */ public static byte[] getBinarySecret(EntropyType entropy) { byte[] secret = null; for (Object obj : entropy.getAny()) { if (obj instanceof BinarySecretType) { BinarySecretType binarySecret = (BinarySecretType) obj; secret = binarySecret.getValue(); break; } } return secret; }
if (StaxParserUtil.matches(subEvent, WSTrustConstants.BINARY_SECRET)) BinarySecretType binarySecret = new BinarySecretType(); Attribute typeAttribute = subEvent.getAttributeByName(new QName("", "Type")); binarySecret.setType(StaxParserUtil.getAttributeValue(typeAttribute)); binarySecret.setValue(StaxParserUtil.getElementText(xmlEventReader).getBytes()); entropy.addAny(binarySecret); if (StaxParserUtil.matches(subEvent, WSTrustConstants.BINARY_SECRET)) BinarySecretType binarySecret = new BinarySecretType(); Attribute typeAttribute = subEvent.getAttributeByName(new QName("", "Type")); binarySecret.setType(StaxParserUtil.getAttributeValue(typeAttribute)); binarySecret.setValue(StaxParserUtil.getElementText(xmlEventReader).getBytes()); requestedProofToken.add(binarySecret);
BinarySecretType serverBinarySecret = new BinarySecretType(); serverBinarySecret.setType(WSTrustConstants.BS_TYPE_NONCE); serverBinarySecret.setValue(Base64.encodeBytes(serverSecret).getBytes()); requestContext.setProofTokenInfo(WSTrustUtil.createKeyInfo(serverBinarySecret.getValue(), providerPublicKey, keyWrapAlgo));
/** * <p> * Parses the specified {@code EntropyType} and returns the first binary secret contained in the entropy. * </p> * * @param entropy a reference to the {@code EntropyType} that contains the binary secret. * * @return a {@code byte[]} containing the secret; {@code null} if the specified entropy doesn't contain any * secret. */ public static byte[] getBinarySecret(EntropyType entropy) { byte[] secret = null; for (Object obj : entropy.getAny()) { if (obj instanceof BinarySecretType) { BinarySecretType binarySecret = (BinarySecretType) obj; secret = binarySecret.getValue(); break; } } return secret; }
subEvent = StaxParserUtil.getNextStartElement(xmlEventReader); if (StaxParserUtil.matches(subEvent, WSTrustConstants.BINARY_SECRET)) { BinarySecretType binarySecret = new BinarySecretType(); Attribute typeAttribute = subEvent.getAttributeByName(new QName("", "Type")); if (typeAttribute != null) { binarySecret.setType(StaxParserUtil.getAttributeValue(typeAttribute)); throw logger.parserExpectedTextValue("binary secret value"); binarySecret.setValue(StaxParserUtil.getElementText(xmlEventReader).getBytes()); entropy.addAny(binarySecret); subEvent = StaxParserUtil.getNextStartElement(xmlEventReader); if (StaxParserUtil.matches(subEvent, WSTrustConstants.BINARY_SECRET)) { BinarySecretType binarySecret = new BinarySecretType(); Attribute typeAttribute = subEvent.getAttributeByName(new QName("", "Type")); binarySecret.setType(StaxParserUtil.getAttributeValue(typeAttribute)); binarySecret.setValue(StaxParserUtil.getElementText(xmlEventReader).getBytes()); requestedProofToken.add(binarySecret); } else if (StaxParserUtil.matches(subEvent, WSTrustConstants.COMPUTED_KEY)) {
/** * Write a {@code BinarySecretType} to stream * @param writer * @param binarySecret * @throws ProcessingException */ private void writeBinarySecretType(XMLStreamWriter writer, BinarySecretType binarySecret) throws ProcessingException { StaxUtil.writeStartElement(writer, PREFIX, WSTrustConstants.BINARY_SECRET, BASE_NAMESPACE); String type = binarySecret.getType(); StaxUtil.writeAttribute(writer, WSTrustConstants.TYPE, type); StaxUtil.writeCharacters(writer, new String(binarySecret.getValue())); StaxUtil.writeEndElement(writer); }
/** * <p> * Parses the specified {@code EntropyType} and returns the first binary secret contained in the entropy. * </p> * * @param entropy a reference to the {@code EntropyType} that contains the binary secret. * @return a {@code byte[]} containing the secret; {@code null} if the specified entropy doesn't contain * any secret. */ public static byte[] getBinarySecret(EntropyType entropy) { byte[] secret = null; for (Object obj : entropy.getAny()) { if (obj instanceof BinarySecretType) { BinarySecretType binarySecret = (BinarySecretType) obj; secret = binarySecret.getValue(); break; } } return secret; }
subEvent = StaxParserUtil.getNextStartElement(xmlEventReader); if (StaxParserUtil.matches(subEvent, WSTrustConstants.BINARY_SECRET)) { BinarySecretType binarySecret = new BinarySecretType(); Attribute typeAttribute = subEvent.getAttributeByName(new QName("", "Type")); if (typeAttribute != null) { binarySecret.setType(StaxParserUtil.getAttributeValue(typeAttribute)); throw logger.parserExpectedTextValue("binary secret value"); binarySecret.setValue(StaxParserUtil.getElementText(xmlEventReader).getBytes()); entropy.addAny(binarySecret); subEvent = StaxParserUtil.getNextStartElement(xmlEventReader); if (StaxParserUtil.matches(subEvent, WSTrustConstants.BINARY_SECRET)) { BinarySecretType binarySecret = new BinarySecretType(); Attribute typeAttribute = subEvent.getAttributeByName(new QName("", "Type")); binarySecret.setType(StaxParserUtil.getAttributeValue(typeAttribute)); binarySecret.setValue(StaxParserUtil.getElementText(xmlEventReader).getBytes()); requestedProofToken.add(binarySecret); } else if (StaxParserUtil.matches(subEvent, WSTrustConstants.COMPUTED_KEY)) {
/** * Write a {@code BinarySecretType} to stream * @param writer * @param binarySecret * @throws ProcessingException */ private void writeBinarySecretType(XMLStreamWriter writer, BinarySecretType binarySecret) throws ProcessingException { StaxUtil.writeStartElement(writer, PREFIX, WSTrustConstants.BINARY_SECRET, BASE_NAMESPACE); String type = binarySecret.getType(); StaxUtil.writeAttribute(writer, WSTrustConstants.TYPE, type); StaxUtil.writeCharacters(writer, new String(binarySecret.getValue())); StaxUtil.writeEndElement(writer); }
/** * <p> * Parses the specified {@code EntropyType} and returns the first binary secret contained in the entropy. * </p> * * @param entropy a reference to the {@code EntropyType} that contains the binary secret. * * @return a {@code byte[]} containing the secret; {@code null} if the specified entropy doesn't contain any * secret. */ public static byte[] getBinarySecret(EntropyType entropy) { byte[] secret = null; for (Object obj : entropy.getAny()) { if (obj instanceof BinarySecretType) { BinarySecretType binarySecret = (BinarySecretType) obj; secret = binarySecret.getValue(); break; } } return secret; }
subEvent = StaxParserUtil.getNextStartElement(xmlEventReader); if (StaxParserUtil.matches(subEvent, WSTrustConstants.BINARY_SECRET)) { BinarySecretType binarySecret = new BinarySecretType(); Attribute typeAttribute = subEvent.getAttributeByName(new QName("", "Type")); if (typeAttribute != null) { binarySecret.setType(StaxParserUtil.getAttributeValue(typeAttribute)); throw logger.parserExpectedTextValue("binary secret value"); binarySecret.setValue(StaxParserUtil.getElementText(xmlEventReader).getBytes()); entropy.addAny(binarySecret); subEvent = StaxParserUtil.getNextStartElement(xmlEventReader); if (StaxParserUtil.matches(subEvent, WSTrustConstants.BINARY_SECRET)) { BinarySecretType binarySecret = new BinarySecretType(); Attribute typeAttribute = subEvent.getAttributeByName(new QName("", "Type")); binarySecret.setType(StaxParserUtil.getAttributeValue(typeAttribute)); binarySecret.setValue(StaxParserUtil.getElementText(xmlEventReader).getBytes()); requestedProofToken.add(binarySecret); } else if (StaxParserUtil.matches(subEvent, WSTrustConstants.COMPUTED_KEY)) {
/** * Write a {@code BinarySecretType} to stream * @param writer * @param binarySecret * @throws ProcessingException */ private void writeBinarySecretType(XMLStreamWriter writer, BinarySecretType binarySecret) throws ProcessingException { StaxUtil.writeStartElement(writer, PREFIX, WSTrustConstants.BINARY_SECRET, BASE_NAMESPACE); String type = binarySecret.getType(); StaxUtil.writeAttribute(writer, WSTrustConstants.TYPE, type); StaxUtil.writeCharacters(writer, new String(binarySecret.getValue())); StaxUtil.writeEndElement(writer); }
/** * <p> * Parses the specified {@code EntropyType} and returns the first binary secret contained in the entropy. * </p> * * @param entropy a reference to the {@code EntropyType} that contains the binary secret. * @return a {@code byte[]} containing the secret; {@code null} if the specified entropy doesn't contain * any secret. */ public static byte[] getBinarySecret(EntropyType entropy) { byte[] secret = null; for (Object obj : entropy.getAny()) { if (obj instanceof BinarySecretType) { BinarySecretType binarySecret = (BinarySecretType) obj; secret = binarySecret.getValue(); break; } } return secret; }
if (StaxParserUtil.matches(subEvent, WSTrustConstants.BINARY_SECRET)) BinarySecretType binarySecret = new BinarySecretType(); Attribute typeAttribute = subEvent.getAttributeByName(new QName("", "Type")); binarySecret.setType(StaxParserUtil.getAttributeValue(typeAttribute)); binarySecret.setValue(StaxParserUtil.getElementText(xmlEventReader).getBytes()); entropy.addAny(binarySecret);
/** * Write a {@code BinarySecretType} to stream * * @param writer * @param binarySecret * @throws ProcessingException */ private void writeBinarySecretType(XMLStreamWriter writer, BinarySecretType binarySecret) throws ProcessingException { StaxUtil.writeStartElement(writer, PREFIX, WSTrustConstants.BINARY_SECRET, BASE_NAMESPACE); String type = binarySecret.getType(); StaxUtil.writeAttribute(writer, WSTrustConstants.TYPE, type); StaxUtil.writeCharacters(writer, new String(binarySecret.getValue())); StaxUtil.writeEndElement(writer); }
subEvent = StaxParserUtil.getNextStartElement(xmlEventReader); if (StaxParserUtil.matches(subEvent, WSTrustConstants.BINARY_SECRET)) { BinarySecretType binarySecret = new BinarySecretType(); Attribute typeAttribute = subEvent.getAttributeByName(new QName("", "Type")); binarySecret.setType(StaxParserUtil.getAttributeValue(typeAttribute)); binarySecret.setValue(StaxParserUtil.getElementText(xmlEventReader).getBytes()); entropy.addAny(binarySecret);
/** * Write a {@code BinarySecretType} to stream * * @param writer * @param binarySecret * * @throws ProcessingException */ private void writeBinarySecretType(XMLStreamWriter writer, BinarySecretType binarySecret) throws ProcessingException { StaxUtil.writeStartElement(writer, PREFIX, WSTrustConstants.BINARY_SECRET, BASE_NAMESPACE); String type = binarySecret.getType(); StaxUtil.writeAttribute(writer, WSTrustConstants.TYPE, type); StaxUtil.writeCharacters(writer, new String(binarySecret.getValue())); StaxUtil.writeEndElement(writer); }