/** * Apply base64 decoding on the message and return the byte array * @param encodedString * @return */ public static byte[] base64Decode(String encodedString) { if (encodedString == null) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "encodedString"); return Base64.decode(encodedString); }
/** * Apply base64 decoding on the message and return the byte array * @param encodedString * @return */ public static byte[] base64Decode(String encodedString) { if (encodedString == null) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "encodedString"); return Base64.decode(encodedString); }
/** * On the byte array, apply URL decoding followed by base64 decoding * @param encodedString * @return * @throws IOException */ public static byte[] urlBase64Decode(String encodedString) throws IOException { String decodedString = urlDecode(encodedString); return Base64.decode(decodedString); }
/** * Base64 decode followed by Deflate decoding * * @param encodedString * @return */ public static InputStream base64DeflateDecode(String encodedString) { byte[] base64decodedMsg = Base64.decode(encodedString); return DeflateUtil.decode(base64decodedMsg); }
/** * Base64 decode followed by Deflate decoding * @param encodedString * @return */ public static InputStream base64DeflateDecode(String encodedString) { byte[] base64decodedMsg = Base64.decode(encodedString); return DeflateUtil.decode(base64decodedMsg); }
/** * On the byte array, apply URL decoding followed by base64 decoding * * @param encodedString * @return * @throws IOException */ public static byte[] urlBase64Decode(String encodedString) throws IOException { String decodedString = urlDecode(encodedString); return Base64.decode(decodedString); }
public static String decode64(String secret, String cipherAlgorithm, SecretKey cipherKey, PBEParameterSpec cipherSpec) throws GeneralSecurityException, UnsupportedEncodingException { byte[] encoding = Base64.decode( secret ); byte[] decode = decode(encoding, cipherAlgorithm, cipherKey, cipherSpec); return new String(decode, "UTF-8"); }
public static String decode64(String secret, String cipherAlgorithm, SecretKey cipherKey, PBEParameterSpec cipherSpec) throws GeneralSecurityException, UnsupportedEncodingException { byte[] encoding = Base64.decode( secret ); byte[] decode = decode(encoding, cipherAlgorithm, cipherKey, cipherSpec); return new String(decode, "UTF-8"); }
/** * Apply base64 decoding on the message and return the byte array * * @param encodedString * @return */ public static byte[] base64Decode(String encodedString) { if (encodedString == null) throw logger.nullArgumentError("encodedString"); return Base64.decode(encodedString); }
public static String decode64(String secret, String cipherAlgorithm, SecretKey cipherKey, PBEParameterSpec cipherSpec) throws GeneralSecurityException, UnsupportedEncodingException { byte[] encoding = Base64.decode(secret); byte[] decode = decode(encoding, cipherAlgorithm, cipherKey, cipherSpec); return new String(decode, "UTF-8"); }
/** * Base64 decode followed by Deflate decoding * @param encodedString * @return */ public static InputStream base64DeflateDecode(String encodedString) { byte[] base64decodedMsg = Base64.decode(encodedString); return DeflateUtil.decode(base64decodedMsg); }
/** * On the byte array, apply URL decoding followed by base64 decoding * @param encodedString * @return * @throws IOException */ public static byte[] urlBase64Decode(String encodedString) throws IOException { String decodedString = urlDecode(encodedString); return Base64.decode(decodedString); }
/** * Convert to the JDK representation of a RSA Public Key * @return * @throws ProcessingException */ public RSAPublicKey convertToPublicKey() throws ProcessingException{ BigInteger bigModulus = new BigInteger(1, massage(Base64.decode(new String(modulus)))); BigInteger bigEx = new BigInteger(1, massage(Base64.decode(new String(exponent)))); try { KeyFactory rsaKeyFactory = KeyFactory.getInstance("rsa"); RSAPublicKeySpec kspec = new RSAPublicKeySpec(bigModulus,bigEx); return (RSAPublicKey) rsaKeyFactory.generatePublic(kspec); } catch (Exception e) { throw new ProcessingException(e); } }
byte[] objBytes = decode(encodedObject);
/** * Convert to the JDK representation of a RSA Private Key * @return * @throws ProcessingException */ public RSAPrivateKey convertToPrivateKey() throws ProcessingException{ BigInteger bigModulus = new BigInteger(1, massage(Base64.decode(new String(modulus)))); BigInteger bigEx = new BigInteger(1, massage(Base64.decode(new String(exponent)))); try { KeyFactory rsaKeyFactory = KeyFactory.getInstance("rsa"); RSAPrivateKeySpec kspec = new RSAPrivateKeySpec(bigModulus,bigEx); return (RSAPrivateKey) rsaKeyFactory.generatePrivate(kspec); } catch (Exception e) { throw new ProcessingException(e); } }
/** * Convert to the JDK representation of a DSA Public Key * @return * @throws ProcessingException */ public DSAPublicKey convertToPublicKey() throws ProcessingException{ BigInteger BigY, BigP, BigQ, BigG; BigY = new BigInteger(1, massage(Base64.decode(new String(y)))); BigP = new BigInteger(1, massage(Base64.decode(new String(p)))); BigQ = new BigInteger(1, massage(Base64.decode(new String(q)))); BigG = new BigInteger(1, massage(Base64.decode(new String(g)))); try { KeyFactory dsaKeyFactory = KeyFactory.getInstance("dsa"); DSAPublicKeySpec kspec = new DSAPublicKeySpec(BigY, BigP, BigQ, BigG); return (DSAPublicKey) dsaKeyFactory.generatePublic(kspec); } catch (Exception e) { throw new ProcessingException(e); } }
/** * Convert to the JDK representation of a DSA Private Key * @return * @throws ProcessingException */ public DSAPrivateKey convertToPrivateKey() throws ProcessingException{ BigInteger BigY, BigP, BigQ, BigG; BigY = new BigInteger(1, massage(Base64.decode(new String(y)))); BigP = new BigInteger(1, massage(Base64.decode(new String(p)))); BigQ = new BigInteger(1, massage(Base64.decode(new String(q)))); BigG = new BigInteger(1, massage(Base64.decode(new String(g)))); try { KeyFactory dsaKeyFactory = KeyFactory.getInstance("dsa"); DSAPrivateKeySpec kspec = new DSAPrivateKeySpec(BigY, BigP, BigQ, BigG); return (DSAPrivateKey) dsaKeyFactory.generatePrivate(kspec); } catch (Exception e) { throw new ProcessingException(e); } }
byte[] objBytes = decode(encodedObject);
byte[] objBytes = decode(encodedObject);
bytes = decode(bytes, 0, bytes.length);