/** * Given an assertion byte array, parse into {@link org.picketlink.identity.federation.saml.v2.assertion.AssertionType} * @param assertionAsString * @return * @throws IOException * @throws ParsingException */ public AssertionType parseAssertion(byte[] assertionAsBytes) throws IOException, ParsingException{ SAMLParser samlParser = new SAMLParser(); return (AssertionType) samlParser.parse(new ByteArrayInputStream(assertionAsBytes)); }
/** * Given an assertion byte array, parse into {@link org.picketlink.identity.federation.saml.v2.assertion.AssertionType} * @param assertionAsString * @return * @throws IOException * @throws ParsingException */ public AssertionType parseAssertion(byte[] assertionAsBytes) throws IOException, ParsingException{ SAMLParser samlParser = new SAMLParser(); return (AssertionType) samlParser.parse(new ByteArrayInputStream(assertionAsBytes)); }
private EntitiesDescriptorType parseMDFile() throws ParsingException { InputStream is = SecurityActions.loadStream(getClass(), SP_MD_FILE); if (is == null) throw new IllegalStateException(ErrorCodes.NULL_VALUE + SP_MD_FILE); SAMLParser parser = new SAMLParser(); return (EntitiesDescriptorType) parser.parse(is); } }
private EntitiesDescriptorType parseMDFile() throws ParsingException { InputStream is = SecurityActions.loadStream(getClass(), IDP_MD_FILE); if (is == null) throw new IllegalStateException(ErrorCodes.NULL_VALUE + IDP_MD_FILE); SAMLParser parser = new SAMLParser(); return (EntitiesDescriptorType) parser.parse(is); } }
private EntitiesDescriptorType parseMDFile() throws ParsingException { InputStream is = SecurityActions.loadStream(getClass(), SP_MD_FILE); if (is == null) throw new IllegalStateException(ErrorCodes.NULL_VALUE + SP_MD_FILE); SAMLParser parser = new SAMLParser(); return (EntitiesDescriptorType) parser.parse(is); } }
private EntitiesDescriptorType parseMDFile() throws ParsingException { InputStream is = SecurityActions.loadStream(getClass(), SP_MD_FILE); if (is == null) throw new IllegalStateException(ErrorCodes.NULL_VALUE + SP_MD_FILE); SAMLParser parser = new SAMLParser(); return (EntitiesDescriptorType) parser.parse(is); } }
private EntitiesDescriptorType parseMDFile() throws ParsingException { InputStream is = SecurityActions.loadStream(getClass(), IDP_MD_FILE); if (is == null) throw new IllegalStateException(ErrorCodes.NULL_VALUE + IDP_MD_FILE); SAMLParser parser = new SAMLParser(); return (EntitiesDescriptorType) parser.parse(is); } }
private EntitiesDescriptorType parseMDFile() throws ParsingException { InputStream is = SecurityActions.loadStream(getClass(), SP_MD_FILE); if (is == null) throw new IllegalStateException(ErrorCodes.NULL_VALUE + SP_MD_FILE); SAMLParser parser = new SAMLParser(); return (EntitiesDescriptorType) parser.parse(is); } }
/** * Given a base64 encoded assertion string, parse into {@link org.picketlink.identity.federation.saml.v2.assertion.AssertionType} * @param base64EncodedAssertion * @return * @throws ParsingException */ protected AssertionType parseAssertion(String base64EncodedAssertion) throws ParsingException { InputStream inputStream = PostBindingUtil.base64DecodeAsStream(base64EncodedAssertion); // Load the assertion SAMLParser samlParser = new SAMLParser(); return (AssertionType) samlParser.parse(inputStream); }
/** * Given a base64 encoded assertion string, parse into {@link org.picketlink.identity.federation.saml.v2.assertion.AssertionType} * @param base64EncodedAssertion * @return * @throws ParsingException */ protected AssertionType parseAssertion(String base64EncodedAssertion) throws ParsingException { InputStream inputStream = PostBindingUtil.base64DecodeAsStream(base64EncodedAssertion); // Load the assertion SAMLParser samlParser = new SAMLParser(); return (AssertionType) samlParser.parse(inputStream); }
private EntitiesDescriptorType parseMDFile() throws ParsingException { InputStream is = SecurityActions.loadStream(getClass(), SP_MD_FILE); if (is == null) throw logger.nullValueError(SP_MD_FILE); SAMLParser parser = new SAMLParser(); return (EntitiesDescriptorType) parser.parse(is); } }
private Object parseMDFile() throws ParsingException { InputStream is = SecurityActions.loadStream(getClass(), SP_MD_FILE); if (is == null) throw logger.nullValueError(SP_MD_FILE); SAMLParser parser = new SAMLParser(); return parser.parse(is); } }
private EntitiesDescriptorType parseMDFile() throws ParsingException { InputStream is = SecurityActions.loadStream(getClass(), IDP_MD_FILE); if (is == null) throw logger.nullValueError(IDP_MD_FILE); SAMLParser parser = new SAMLParser(); return (EntitiesDescriptorType) parser.parse(is); }
/** * Given a {@link Element} that represents a SAML 1.1 assertion, convert it into a {@link SAML11AssertionType} * @param assertionElement * @return * @throws GeneralSecurityException */ public static SAML11AssertionType saml11FromElement(Element assertionElement) throws GeneralSecurityException { SAMLParser samlParser = new SAMLParser(); JAXPValidationUtil.checkSchemaValidation(assertionElement); return (SAML11AssertionType) samlParser.parse(DocumentUtil.getNodeAsStream(assertionElement)); } }
/** * Given a {@link Element} that represents a SAML 1.1 assertion, convert it into a {@link SAML11AssertionType} * @param assertionElement * @return * @throws GeneralSecurityException */ public static SAML11AssertionType saml11FromElement(Element assertionElement) throws GeneralSecurityException { SAMLParser samlParser = new SAMLParser(); JAXPValidationUtil.checkSchemaValidation(assertionElement); return (SAML11AssertionType) samlParser.parse(DocumentUtil.getNodeAsStream(assertionElement)); } }
/** * Given a {@link Element} that represents a SAML 1.1 assertion, convert it into a {@link SAML11AssertionType} * * @param assertionElement * @return * @throws GeneralSecurityException */ public static SAML11AssertionType saml11FromElement(Element assertionElement) throws GeneralSecurityException { SAMLParser samlParser = new SAMLParser(); JAXPValidationUtil.checkSchemaValidation(assertionElement); return (SAML11AssertionType) samlParser.parse(DocumentUtil.getNodeAsStream(assertionElement)); } }
private Object parseSPMetadata() throws ParsingException { InputStream spMetadataStream = SecurityActions.loadStream(getClass(), getSpMetadataLocation()); if (spMetadataStream == null) { throw logger.nullValueError(getSpMetadataLocation()); } return new SAMLParser().parse(spMetadataStream); }
private Object parseSPMetadata() throws ParsingException { InputStream spMetadataStream = SecurityActions.loadStream(getClass(), getSpMetadataLocation()); if (spMetadataStream == null) { throw logger.nullValueError(getSpMetadataLocation()); } return new SAMLParser().parse(spMetadataStream); }
private EntitiesDescriptorType parseMDFile() throws ParsingException { InputStream is = SecurityActions.loadStream(getClass(), getIdpMetadataLocation()); if (is == null) throw logger.nullValueError(getIdpMetadataLocation()); Object idpMetadata = new SAMLParser().parse(is); EntitiesDescriptorType entities; if (EntitiesDescriptorType.class.isInstance(idpMetadata)) { entities = (EntitiesDescriptorType) idpMetadata; } else { entities = new EntitiesDescriptorType(); entities.addEntityDescriptor(idpMetadata); } return entities; }
private EntitiesDescriptorType parseMDFile() throws ParsingException { InputStream is = SecurityActions.loadStream(getClass(), getIdpMetadataLocation()); if (is == null) throw logger.nullValueError(getIdpMetadataLocation()); Object idpMetadata = new SAMLParser().parse(is); EntitiesDescriptorType entities; if (EntitiesDescriptorType.class.isInstance(idpMetadata)) { entities = (EntitiesDescriptorType) idpMetadata; } else { entities = new EntitiesDescriptorType(); entities.addEntityDescriptor(idpMetadata); } return entities; }