Class UserCertEncryptor
java.lang.Object
org.ofdrw.crypto.enryptor.UserCertEncryptor
- All Implemented Interfaces:
UserFEKEncryptor
OFD用户证书加密器
- Since:
- 2021-7-29 18:36:07
- Author:
- 权观宇
-
Constructor Summary
ConstructorsConstructorDescriptionUserCertEncryptor(String username, String userType, Certificate certificate) OFD用户数字证书加密器UserCertEncryptor(String username, Certificate certificate) OFD用户数字证书加密器 -
Method Summary
-
Constructor Details
-
UserCertEncryptor
OFD用户数字证书加密器- Parameters:
username- 用户名称userType- 用户角色类型UserInfo.UserTypeOwnerUserInfo.UserTypeUsercertificate- 用户数字证书
-
UserCertEncryptor
OFD用户数字证书加密器用户类型:User(用户)
UserInfo.UserTypeUser- Parameters:
username- 用户名称certificate- 用户数字证书
-
-
Method Details
-
encrypt
public org.ofdrw.core.crypto.encryt.UserInfo encrypt(byte[] fek, byte[] iv) throws org.bouncycastle.crypto.CryptoException, IOException, GeneralSecurityException 加密 文件加密密钥 并封装为- Specified by:
encryptin interfaceUserFEKEncryptor- Parameters:
fek- 文件加密密钥(File Encrypt Key )iv- 加密向量IV- Returns:
- 用户信息(包含加密的文件加密密钥)
- Throws:
org.bouncycastle.crypto.CryptoException- 加密过程运行异常IOException- IO操作异常GeneralSecurityException- 加密异常
-
userCert
用户加密时使用的证书,仅在使用证书加密的加密器中需要实现- Specified by:
userCertin interfaceUserFEKEncryptor- Returns:
- 证书文件字节内容(DER编码),在使用口令加密时可返还null
- Throws:
GeneralSecurityException- 证书编码错误
-
encryptCaseId
加密保护方案标识,见附录 A.1ProtectionCaseID- Specified by:
encryptCaseIdin interfaceUserFEKEncryptor- Returns:
- 加密保护方案标识
-