Class McElieceKobaraImaiCipherSpi

All Implemented Interfaces:
PKCSObjectIdentifiers, X509ObjectIdentifiers
Direct Known Subclasses:
McElieceKobaraImaiCipherSpi.McElieceKobaraImai, McElieceKobaraImaiCipherSpi.McElieceKobaraImai224, McElieceKobaraImaiCipherSpi.McElieceKobaraImai256, McElieceKobaraImaiCipherSpi.McElieceKobaraImai384, McElieceKobaraImaiCipherSpi.McElieceKobaraImai512

public class McElieceKobaraImaiCipherSpi extends AsymmetricHybridCipher implements PKCSObjectIdentifiers, X509ObjectIdentifiers
  • Constructor Details

    • McElieceKobaraImaiCipherSpi

      public McElieceKobaraImaiCipherSpi()
    • McElieceKobaraImaiCipherSpi

      protected McElieceKobaraImaiCipherSpi(Digest digest, McElieceKobaraImaiCipher cipher)
  • Method Details

    • update

      public byte[] update(byte[] input, int inOff, int inLen)
      Continue a multiple-part encryption or decryption operation.
      Specified by:
      update in class AsymmetricHybridCipher
      Parameters:
      input - byte array containing the next part of the input
      inOff - index in the array where the input starts
      inLen - length of the input
      Returns:
      the processed byte array.
    • doFinal

      public byte[] doFinal(byte[] input, int inOff, int inLen) throws BadPaddingException
      Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. The data is encrypted or decrypted, depending on how this cipher was initialized.
      Specified by:
      doFinal in class AsymmetricHybridCipher
      Parameters:
      input - the input buffer
      inOff - the offset in input where the input starts
      inLen - the input length
      Returns:
      the new buffer with the result
      Throws:
      BadPaddingException - if this cipher is in decryption mode, and (un)padding has been requested, but the decrypted data is not bounded by the appropriate padding bytes
    • encryptOutputSize

      protected int encryptOutputSize(int inLen)
      Description copied from class: AsymmetricHybridCipher
      Compute the output size of an update() or doFinal() operation of a hybrid asymmetric cipher in encryption mode when given input of the specified length.
      Specified by:
      encryptOutputSize in class AsymmetricHybridCipher
      Parameters:
      inLen - the length of the input
      Returns:
      the output size
    • decryptOutputSize

      protected int decryptOutputSize(int inLen)
      Description copied from class: AsymmetricHybridCipher
      Compute the output size of an update() or doFinal() operation of a hybrid asymmetric cipher in decryption mode when given input of the specified length.
      Specified by:
      decryptOutputSize in class AsymmetricHybridCipher
      Parameters:
      inLen - the length of the input
      Returns:
      the output size
    • initCipherEncrypt

      protected void initCipherEncrypt(Key key, AlgorithmParameterSpec params, SecureRandom sr) throws InvalidKeyException, InvalidAlgorithmParameterException
      Description copied from class: AsymmetricHybridCipher
      Initialize the AsymmetricHybridCipher with a certain key for data encryption.
      Specified by:
      initCipherEncrypt in class AsymmetricHybridCipher
      Parameters:
      key - the key which has to be used to encrypt data
      params - the algorithm parameters
      sr - the source of randomness
      Throws:
      InvalidKeyException - if the given key is inappropriate for initializing this cipher.
      InvalidAlgorithmParameterException - if the given parameters are inappropriate for initializing this cipher.
    • initCipherDecrypt

      protected void initCipherDecrypt(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException
      Description copied from class: AsymmetricHybridCipher
      Initialize the AsymmetricHybridCipher with a certain key for data encryption.
      Specified by:
      initCipherDecrypt in class AsymmetricHybridCipher
      Parameters:
      key - the key which has to be used to decrypt data
      params - the algorithm parameters
      Throws:
      InvalidKeyException - if the given key is inappropriate for initializing this cipher
      InvalidAlgorithmParameterException - if the given parameters are inappropriate for initializing this cipher.
    • getName

      public String getName()
      Specified by:
      getName in class CipherSpiExt
      Returns:
      the name of this cipher
    • getKeySize

      public int getKeySize(Key key) throws InvalidKeyException
      Description copied from class: CipherSpiExt
      Return the key size of the given key object in bits.
      Specified by:
      getKeySize in class CipherSpiExt
      Parameters:
      key - the key object
      Returns:
      the key size in bits of the given key object
      Throws:
      InvalidKeyException - if key is invalid.