All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.interledger.crypto.EncryptionAlgorithm Maven / Gradle / Ivy

Go to download

Encryption, decryption, signing and verification services using various underlying key-stores.

The newest version!
package org.interledger.crypto;

/**
 * Defines supported encryption algorithms.
 */
public enum EncryptionAlgorithm {

  // Google KMS
  GOOGLE_SYMMETRIC(CryptoConstants.GOOGLE_SYMMETRIC),
  AES_GCM(CryptoConstants.AES_GCM);

  private final String algorithm;

  EncryptionAlgorithm(final String algorithm) {
    this.algorithm = algorithm;
  }

  static EncryptionAlgorithm fromEncodedValue(final String encodedValue) {
    switch (encodedValue.toLowerCase()) {
      case CryptoConstants.GOOGLE_SYMMETRIC: {
        return GOOGLE_SYMMETRIC;
      }
      case CryptoConstants.AES_GCM: {
        return AES_GCM;
      }
      default: {
        throw new RuntimeException("Invalid Encryption Algorithm: " + encodedValue);
      }
    }
  }

  public String getAlgorithm() {
    return algorithm;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy