Class KeyUtil

java.lang.Object
org.kopi.ebics.certificate.KeyUtil

public final class KeyUtil extends Object
Some key utilities
  • Method Details

    • makeKeyPair

      public static KeyPair makeKeyPair(int keyLen) throws NoSuchAlgorithmException
      Generates a KeyPair in RSA format.
      Parameters:
      keyLen - - key size
      Returns:
      KeyPair the key pair
      Throws:
      NoSuchAlgorithmException
    • getKeyDigest

      public static byte[] getKeyDigest(RSAPublicKey publicKey) throws EbicsException
      Returns the digest value of a given public key.

      In Version “H003” of the EBICS protocol the ES of the financial:

      The SHA-256 hash values of the financial institution's public keys for X002 and E002 are composed by concatenating the exponent with a blank character and the modulus in hexadecimal representation (using lower case letters) without leading zero (as to the hexadecimal representation). The resulting string has to be converted into a byte array based on US ASCII code.

      Parameters:
      publicKey - the public key
      Returns:
      the digest value
      Throws:
      EbicsException