public static String encode64(byte[] secret, String cipherAlgorithm, SecretKey cipherKey, PBEParameterSpec cipherSpec) throws Exception { byte[] encoding = encode(secret, cipherAlgorithm, cipherKey, cipherSpec); String b64 = Base64.encodeBytes( encoding ); return b64; }
/** * Get the {@link Validator} for JAXP Validation * * @return * @throws SAXException * @throws IOException */ public static Validator getSchemaValidator() throws SAXException, IOException { return JAXPValidationUtil.validator(); }
/** * <p> * Creates a {@code WSTrustRequestWriter} that writes {@code RequestSecurityToken} instances to the specified * {@code OutputStream}. * </p> * * @param out the stream where the request is to be written. * @throws ProcessingException if an error occurs while processing the request. */ public WSTrustRequestWriter(OutputStream out) throws ProcessingException { this.writer = StaxUtil.getXMLStreamWriter(out); }
/** * Set the client secret for facebook * * @param clientSecret */ public void setClientSecret(String clientSecret) { this.clientSecret = StringUtil.getSystemPropertyAsString(clientSecret); }
/** * Encodes a byte array into Base64 notation. Does not GZip-compress data. * * @param source The data to convert * @return the encode bytes * @since 1.4 */ public static String encodeBytes(byte[] source) { return encodeBytes(source, 0, source.length, NO_OPTIONS); } // end encodeBytes
/** * Get the System Property * @param key key of the system property * @param defaultValue default value to be returned if the system property is not set * @return */ public static String getSystemProperty(final String key, final String defaultValue){ return SecurityActions.getSystemProperty(key,defaultValue); } }
public void fatalError(SAXParseException ex) throws SAXException { logException(ex); throw ex; }
/** * Set to false, if you do not want to include keyinfo in the signature * * @param val * * @since v2.0.1 */ public void setSignatureIncludeKeyInfo(boolean val) { if (!val) { XMLSignatureUtil.setIncludeKeyInfoInSignature(false); } }
/** * Use the transformer to transform * * @param transformer * @param stax * @param result * @throws ParsingException */ public static void transform(Transformer transformer, StAXSource stax, DOMResult result) throws ParsingException { transform(transformer, (Source)stax, result); }
/** * Serializes an object and returns the Base64-encoded version of that serialized object. If the object cannot be serialized * or there is another error, the method will return <tt>null</tt>. The object is not GZip-compressed before being encoded. * * @param serializableObject The object to encode * @return The Base64-encoded object * @since 1.4 */ public static String encodeObject(java.io.Serializable serializableObject) { return encodeObject(serializableObject, NO_OPTIONS); } // end encodeObject
/** * Suspends encoding of the stream. May be helpful if you need to embed a piece of base640-encoded data in a stream. * * @since 1.5.1 * @throws IOException */ public void suspendEncoding() throws java.io.IOException { flushBase64(); this.suspendEncoding = true; } // end suspendEncoding
/** * Get the Custom Stax Source to DOM result transformer that has been written to get over the JDK transformer bugs (JDK6) as * well as the issue of Xalan installing its Transformer (which does not support stax). * * @return * @throws ConfigurationException */ public static Transformer getStaxSourceToDomResultTransformer() throws ConfigurationException { return new PicketLinkStaxToDOMTransformer(); }
/** * Create new NamespaceContext for use. * * @return */ public static NamespaceContext create() { return new NamespaceContext(); } }
public static String encode64(byte[] secret, String cipherAlgorithm, SecretKey cipherKey, PBEParameterSpec cipherSpec) throws Exception { byte[] encoding = encode(secret, cipherAlgorithm, cipherKey, cipherSpec); String b64 = Base64.encodeBytes(encoding); return b64; }
/** * Set the url where the 3rd party authentication service will redirect after authentication * * @param returnURL */ public void setReturnURL(String returnURL) { this.returnURL = StringUtil.getSystemPropertyAsString(returnURL); }
/** * Get the {@link Validator} for JAXP Validation * @return * @throws SAXException * @throws IOException */ public static Validator getSchemaValidator() throws SAXException, IOException { return JAXPValidationUtil.validator(); } }
/** * <p> * Creates a {@code WSTrustRequestWriter} that writes {@code RequestSecurityToken} instances to the specified {@code Result} * . * </p> * * @param result the {@code Result} where the request it to be written. * @throws ProcessingException if an error occurs while processing the request. */ public WSTrustRequestWriter(Result result) throws ProcessingException { this.writer = StaxUtil.getXMLStreamWriter(result); }
/** * Set to false, if you do not want to include keyinfo in the signature * * @param val * * @since v2.0.1 */ public void setSignatureIncludeKeyInfo(boolean val) { if (!val) { XMLSignatureUtil.setIncludeKeyInfoInSignature(false); } }
public static String encode64(byte[] secret, String cipherAlgorithm, SecretKey cipherKey, PBEParameterSpec cipherSpec) throws Exception { byte[] encoding = encode(secret, cipherAlgorithm, cipherKey, cipherSpec); String b64 = Base64.encodeBytes( encoding ); return b64; }
/** * Set the scope for facebook (Default: email) * * @param facebookScope */ public void setFacebookScope(String facebookScope) { this.facebookScope = StringUtil.getSystemPropertyAsString(facebookScope); }