/** {@inheritDoc} */ protected byte[] toBytes(final char[] password) { return PBEParametersGenerator.PKCS12PasswordToBytes(password); } }
public byte[] convert(char[] password) { return PBEParametersGenerator.PKCS12PasswordToBytes(password); } };
/** * Return the password converted to bytes. * * @return the password converted to a byte array. */ public byte[] getEncoded() { if (useWrongZeroLengthConversion && password.length == 0) { return new byte[2]; } return PBEParametersGenerator.PKCS12PasswordToBytes(password); } }
private static byte[] convertPassword(int type, PBEKeySpec keySpec) { byte[] key; if (type == PKCS12) { key = PBEParametersGenerator.PKCS12PasswordToBytes(keySpec.getPassword()); } else if (type == PKCS5S2_UTF8 || type == PKCS5S1_UTF8) { key = PBEParametersGenerator.PKCS5PasswordToUTF8Bytes(keySpec.getPassword()); } else { key = PBEParametersGenerator.PKCS5PasswordToBytes(keySpec.getPassword()); } return key; } }
MacOutputStream mOut = new MacOutputStream(hMac); PBEParametersGenerator pbeGen = new PKCS12ParametersGenerator(new SHA1Digest()); byte[] passKey = PBEParametersGenerator.PKCS12PasswordToBytes(password);
if (password != null && password.length != 0) byte[] passKey = PBEParametersGenerator.PKCS12PasswordToBytes(password);
return PBEParametersGenerator.PKCS12PasswordToBytes(pbeKeySpec.getPassword());
private byte[] generateKey(KeyDerivationFunc pbkdAlgorithm, String purpose, char[] password, int defKeySize) throws IOException byte[] encPassword = PBEParametersGenerator.PKCS12PasswordToBytes(password); byte[] differentiator = PBEParametersGenerator.PKCS12PasswordToBytes(purpose.toCharArray());
final char[] passwd = param.getReadPassword(0 != lastTry); assert null != passwd; final byte[] pass = PKCS12PasswordToBytes(passwd); for (int i = passwd.length; --i >= 0; ) // nullify password parameter passwd[i] = 0;
final byte[] pwdBytes = PBEParametersGenerator.PKCS12PasswordToBytes(pwdChars); paranoidWipe(pwdChars);