@Override public String getName() { return name(); }
public static KeyUsage fromValue(Integer value) { if (value != null) { for (EnumType e : values()) { if (e.getValue() == value) { return (KeyUsage) e; } } } return UNKNOWN; }
public static boolean verifyWithKey(CheckSum checkSum, byte[] bytes, byte[] key, KeyUsage usage) throws KrbException { CheckSumType checkSumType = checkSum.getCksumtype(); CheckSumTypeHandler handler = getCheckSumHandler(checkSumType); return handler.verifyWithKey(bytes, key, usage.getValue(), checkSum.getChecksum()); } }
public static byte[] decrypt(EncryptionKey key, byte[] cipherData, KeyUsage usage) throws KrbException { EncTypeHandler encType = EncryptionHandler.getEncHandler(key.getKeyType()); return encType.decrypt(cipherData, key.getKeyData(), usage.getValue()); } }
/** * Encrypt * * @param clearText The clear test * @return The cipher text. * @throws Exception e */ public byte[] encrypt(byte[] clearText, KeyUsage usage) throws Exception { // Use the secret key to encrypt/decrypt data. EncTypeHandler encType = EncryptionHandler.getEncHandler(serverKey.getKeyType()); return encType.encrypt(clearText, serverKey.getKeyData(), usage.getValue()); }
public static KeyUsage fromValue(Integer value) { if (value != null) { for (EnumType e : values()) { if (e.getValue() == value) { return (KeyUsage) e; } } } return UNKNOWN; }
@Override public String getName() { return name(); }
/** * Encrypt * * @param clearText The clear test * @return The cipher text. * @throws Exception e */ public byte[] encrypt(byte[] clearText, KeyUsage usage) throws Exception { // Use the secret key to encrypt/decrypt data. EncTypeHandler encType = EncryptionHandler.getEncHandler(serverKey.getKeyType()); return encType.encrypt(clearText, serverKey.getKeyData(), usage.getValue()); }
public static byte[] encrypt(EncryptionKey key, byte[] plaintext, KeyUsage usage) throws KrbException { EncTypeHandler encType = EncryptionHandler.getEncHandler(key.getKeyType()); return encType.encrypt(plaintext, key.getKeyData(), usage.getValue()); }
/** * Decrypt * * @param cipherText * @return The decrypted byte * @throws Exception e */ public byte[] decrypt(byte[] cipherText, KeyUsage usage) throws Exception { // Use the secret key to encrypt/decrypt data. EncTypeHandler encType = EncryptionHandler.getEncHandler(clientKey.getKeyType()); return encType.decrypt(cipherText, clientKey.getKeyData(), usage.getValue()); }
public static byte[] decrypt(EncryptionKey key, byte[] cipherData, KeyUsage usage) throws KrbException { EncTypeHandler encType = EncryptionHandler.getEncHandler(key.getKeyType()); return encType.decrypt(cipherData, key.getKeyData(), usage.getValue()); } }
public static byte[] encrypt(EncryptionKey key, byte[] plaintext, KeyUsage usage) throws KrbException { EncTypeHandler encType = EncryptionHandler.getEncHandler(key.getKeyType()); return encType.encrypt(plaintext, key.getKeyData(), usage.getValue()); }
public static boolean verifyWithKey(CheckSum checkSum, byte[] bytes, byte[] key, KeyUsage usage) throws KrbException { CheckSumType checkSumType = checkSum.getCksumtype(); CheckSumTypeHandler handler = getCheckSumHandler(checkSumType); return handler.verifyWithKey(bytes, key, usage.getValue(), checkSum.getChecksum()); } }
/** * Decrypt with the encryption key and key usage. * * @param data The encrypted data * @param key The encryption key * @param usage The key usage * @return The decrypted data * @throws KrbException e */ public static byte[] decrypt(byte[] data, EncryptionKey key, KeyUsage usage) throws KrbException { EncTypeHandler handler = getEncHandler(key.getKeyType()); return handler.decrypt(data, key.getKeyData(), usage.getValue()); }
/** * Decrypt * * @param cipherText * @return The decrypted byte * @throws Exception e */ public byte[] decrypt(byte[] cipherText, KeyUsage usage) throws Exception { // Use the secret key to encrypt/decrypt data. EncTypeHandler encType = EncryptionHandler.getEncHandler(clientKey.getKeyType()); return encType.decrypt(cipherText, clientKey.getKeyData(), usage.getValue()); }
/** * Decrypt with the encryption key and key usage. * * @param data The encrypted data * @param key The encryption key * @param usage The key usage * @return The decrypted data * @throws KrbException e */ public static byte[] decrypt(byte[] data, EncryptionKey key, KeyUsage usage) throws KrbException { EncTypeHandler handler = getEncHandler(key.getKeyType()); return handler.decrypt(data, key.getKeyData(), usage.getValue()); }
public static CheckSum checksumWithKey(CheckSumType checkSumType, byte[] bytes, byte[] key, KeyUsage usage) throws KrbException { CheckSumTypeHandler handler = getCheckSumHandler(checkSumType); byte[] checksumBytes = handler.checksumWithKey(bytes, key, usage.getValue()); CheckSum checkSum = new CheckSum(); checkSum.setCksumtype(checkSumType); checkSum.setChecksum(checksumBytes); return checkSum; }
public static CheckSum checksumWithKey(CheckSumType checkSumType, byte[] bytes, byte[] key, KeyUsage usage) throws KrbException { CheckSumTypeHandler handler = getCheckSumHandler(checkSumType); byte[] checksumBytes = handler.checksumWithKey(bytes, key, usage.getValue()); CheckSum checkSum = new CheckSum(); checkSum.setCksumtype(checkSumType); checkSum.setChecksum(checksumBytes); return checkSum; }
/** * Decrypt with the encryption key and key usage. * * @param data The encrypted data * @param key The encryption key * @param usage The key usage * @return The decrypted data * @throws KrbException e */ public static byte[] decrypt(EncryptedData data, EncryptionKey key, KeyUsage usage) throws KrbException { EncTypeHandler handler = getEncHandler(key.getKeyType()); return handler.decrypt(data.getCipher(), key.getKeyData(), usage.getValue()); }
/** * Decrypt with the encryption key and key usage. * * @param data The encrypted data * @param key The encryption key * @param usage The key usage * @return The decrypted data * @throws KrbException e */ public static byte[] decrypt(EncryptedData data, EncryptionKey key, KeyUsage usage) throws KrbException { EncTypeHandler handler = getEncHandler(key.getKeyType()); return handler.decrypt(data.getCipher(), key.getKeyData(), usage.getValue()); }