接口 MessageCrypto<MetadataT,​BuilderT>


  • @Public
    @Stable
    public interface MessageCrypto<MetadataT,​BuilderT>
    Interface that abstracts the method to encrypt/decrypt message for End to End Encryption.
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      static int IV_LEN  
    • 方法概要

      所有方法 实例方法 抽象方法 
      修饰符和类型 方法 说明
      void addPublicKeyCipher​(java.util.Set<java.lang.String> keyNames, CryptoKeyReader keyReader)  
      boolean decrypt​(java.util.function.Supplier<MetadataT> messageMetadataSupplier, java.nio.ByteBuffer payload, java.nio.ByteBuffer outBuffer, CryptoKeyReader keyReader)  
      void encrypt​(java.util.Set<java.lang.String> encKeys, CryptoKeyReader keyReader, java.util.function.Supplier<BuilderT> messageMetadataBuilderSupplier, java.nio.ByteBuffer payload, java.nio.ByteBuffer outBuffer)  
      int getMaxOutputSize​(int inputLen)
      Return the maximum for a given buffer to be encrypted or decrypted.
      boolean removeKeyCipher​(java.lang.String keyName)  
    • 方法详细资料

      • removeKeyCipher

        boolean removeKeyCipher​(java.lang.String keyName)
      • getMaxOutputSize

        int getMaxOutputSize​(int inputLen)
        Return the maximum for a given buffer to be encrypted or decrypted. This is meant to allow to pre-allocate a buffer with enough space to be passed as
        参数:
        inputLen - the length of the input buffer
        返回:
        the maximum size of the buffer to hold the encrypted/decrypted version of the input buffer
      • decrypt

        boolean decrypt​(java.util.function.Supplier<MetadataT> messageMetadataSupplier,
                        java.nio.ByteBuffer payload,
                        java.nio.ByteBuffer outBuffer,
                        CryptoKeyReader keyReader)