/** * 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); } }
/** * 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); } }
/** * Encrypt a string into a string using URL safe Base64 encoding. * * @param plainText * text to encrypt * @return encrypted string */ public final String encryptUrlSafe(final String plainText) { try { byte[] cipherText = encryptStringToByteArray(plainText); return new String(Base64UrlSafe.encodeBase64(cipherText)); } catch (GeneralSecurityException e) { log.error("Unable to encrypt text '" + plainText + "'", e); return null; } }
/** * Encrypt a string into a string using URL safe Base64 encoding. * * @param plainText * text to encrypt * @return encrypted string */ public final String encryptUrlSafe(final String plainText) { try { byte[] cipherText = encryptStringToByteArray(plainText); return new String(Base64UrlSafe.encodeBase64(cipherText)); } catch (GeneralSecurityException e) { log.error("Unable to encrypt text '" + plainText + "'", e); return null; } }