Interface UserFEKEncryptor

All Known Implementing Classes:
UserCertEncryptor, UserPasswordEncryptor

public interface UserFEKEncryptor
用户 文件加密密钥 加密器 User File Encrypt Key Encryptor

用于加密 文件加密密钥 生成 UserInfo

Since:
2021-07-13 19:07:11
Author:
权观宇
  • Method Summary

    Modifier and Type
    Method
    Description
    org.ofdrw.core.crypto.encryt.UserInfo
    encrypt(byte[] fek, byte[] iv)
    加密 文件加密密钥 并封装为
    加密保护方案标识,见附录 A.1 ProtectionCaseID
    byte[]
    用户加密时使用的证书,仅在使用证书加密的加密器中需要实现
  • Method Details

    • encrypt

      org.ofdrw.core.crypto.encryt.UserInfo encrypt(byte[] fek, byte[] iv) throws org.bouncycastle.crypto.CryptoException, IOException, GeneralSecurityException
      加密 文件加密密钥 并封装为
      Parameters:
      fek - 文件加密密钥(File Encrypt Key )
      iv - 加密向量IV
      Returns:
      用户信息(包含加密的文件加密密钥)
      Throws:
      org.bouncycastle.crypto.CryptoException - 加密过程运行异常
      IOException - IO操作异常
      GeneralSecurityException - 加密异常
    • userCert

      byte[] userCert() throws GeneralSecurityException
      用户加密时使用的证书,仅在使用证书加密的加密器中需要实现
      Returns:
      证书文件字节内容(DER编码),在使用口令加密时可返还null
      Throws:
      GeneralSecurityException - 证书编码错误
    • encryptCaseId

      String encryptCaseId()
      加密保护方案标识,见附录 A.1 ProtectionCaseID
      Returns:
      加密保护方案标识