/** * Decodes a String containing containing characters in the Base64 alphabet. * * @param pArray * A String containing Base64 character data * @return a byte array containing binary data * @since 1.4 */ public byte[] decode(final String pArray) { return decode(StringUtils.getBytesUtf8(pArray)); }
/** * @return The crypt engine to be used */ protected ICrypt getCrypt() { if (crypt == null) { CachingSunJceCryptFactory cryptFactory = new CachingSunJceCryptFactory(encryptionKey); crypt = cryptFactory.newCrypt(); } return crypt; }
/** * Encodes binary data using the base64 algorithm into 76 character blocks separated by CRLF. * * @param binaryData * binary data to encode * @return String containing Base64 characters. * @since 1.4 */ public static String encodeBase64String(final byte[] binaryData) { return StringUtils.newStringUtf8(encodeBase64(binaryData, true)); }
/** * Decodes a byte[] containing containing characters in the Base64 alphabet. * * @param pArray * A byte array containing Base64 character data * @return a byte array containing binary data */ public byte[] decode(byte[] pArray) { return decodeBase64(pArray); }
/** * @see org.apache.wicket.util.crypt.ICryptFactory#newCrypt() */ public final ICrypt newCrypt() { if (cache == null) { cache = delegate.newCrypt(); } return cache; } }
/** * Encodes binary data using the base64 algorithm and chunks the encoded output into 76 * character blocks * * @param binaryData * binary data to encode * @return Base64 characters chunked in 76 character blocks */ public static byte[] encodeBase64Chunked(byte[] binaryData) { return encodeBase64(binaryData, true); }
/** * Construct. * * @param encryptionKey * encryption key */ public CachingSunJceCryptFactory(String encryptionKey) { super(new ClassCryptFactory(SunJceCrypt.class, encryptionKey)); } }
/** * Encodes a byte[] containing binary data, into a String containing characters in the Base64 * alphabet. * * @param pArray * a byte array containing binary data * @return A String containing only Base64 character data * @since 1.4 */ public String encodeToString(final byte[] pArray) { return StringUtils.newStringUtf8(encode(pArray)); }
/** * @return the {@link org.apache.wicket.util.crypt.ICrypt} to use */ protected ICrypt createCrypt() { return new SunJceCrypt(cryptMethod); } }
/** * Encodes a byte[] containing binary data, into a byte[] containing characters in the Base64 * alphabet. * * @param pArray * a byte array containing binary data * @return A byte array containing only Base64 character data */ public byte[] encode(byte[] pArray) { return encodeBase64(pArray, false); }
/** * Construct. * * @param encryptionKey * encryption key */ public CachingSunJceCryptFactory(String encryptionKey) { super(new ClassCryptFactory(SunJceCrypt.class, encryptionKey)); } }
/** * Encodes binary data using a URL-safe variation of the base64 algorithm but does not chunk the * output. The url-safe variation emits - and _ instead of + and / characters. * * @param binaryData * binary data to encode * @return String containing Base64 characters * @since 1.4 */ public static String encodeBase64URLSafeString(final byte[] binaryData) { return StringUtils.newStringUtf8(encodeBase64(binaryData, false, true)); }
/** * @return The crypt engine to be used */ protected ICrypt getCrypt() { if (crypt == null) { CachingSunJceCryptFactory cryptFactory = new CachingSunJceCryptFactory(encryptionKey); crypt = cryptFactory.newCrypt(); } return crypt; }
/** * @return the {@link org.apache.wicket.util.crypt.ICrypt} to use */ protected ICrypt createCrypt() { return new SunJceCrypt(cryptMethod); } }
/** * Encodes binary data using a URL-safe variation of the base64 algorithm but does not chunk the * output. The url-safe variation emits - and _ instead of + and / characters. * * @param binaryData * binary data to encode * @return byte[] containing Base64 characters in their UTF-8 representation. * @since 1.4 */ public static byte[] encodeBase64URLSafe(final byte[] binaryData) { return encodeBase64(binaryData, false, true); }
/** * Construct. */ public NoCryptFactory() { super(new ClassCryptFactory(NoCrypt.class, ISecuritySettings.DEFAULT_ENCRYPTION_KEY)); }
/** * Encodes binary data using the base64 algorithm but does not chunk the output. * * @param binaryData * binary data to encode * @return byte[] containing Base64 characters in their UTF-8 representation. */ public static byte[] encodeBase64(final byte[] binaryData) { return encodeBase64(binaryData, false); }
/** * Construct. */ public NoCryptFactory() { super(new ClassCryptFactory(NoCrypt.class, ISecuritySettings.DEFAULT_ENCRYPTION_KEY)); }
/** * Encodes binary data using the base64 algorithm and chunks the encoded output into 76 * character blocks * * @param binaryData * binary data to encode * @return Base64 characters chunked in 76 character blocks */ public static byte[] encodeBase64Chunked(final byte[] binaryData) { return encodeBase64(binaryData, true); }