Class UserPasswordEncryptor
java.lang.Object
org.ofdrw.crypto.enryptor.UserPasswordEncryptor
- All Implemented Interfaces:
UserFEKEncryptor
OFD用户口令加密器
密钥派生规则依据:GB/T 32918.3-2016 信息安全技术 SM2椭圆曲线公钥密码算法 第3部分:密钥交换协议 5.4.3 密钥派生函数
- Since:
- 2021-07-28 18:56:12
- Author:
- 权观宇
-
Constructor Summary
ConstructorsConstructorDescriptionUserPasswordEncryptor(String username, String password) OFD用户口令加密器UserPasswordEncryptor(String username, String userType, String password) OFD用户口令加密器 -
Method Summary
-
Constructor Details
-
UserPasswordEncryptor
-
UserPasswordEncryptor
-
-
Method Details
-
encrypt
public org.ofdrw.core.crypto.encryt.UserInfo encrypt(byte[] fek, byte[] iv) throws org.bouncycastle.crypto.CryptoException 加密 文件加密密钥 并封装为- Specified by:
encryptin interfaceUserFEKEncryptor- Parameters:
fek- 文件加密密钥(File Encrypt Key )iv- 加密向量IV- Returns:
- 用户信息(包含加密的文件加密密钥)
- Throws:
org.bouncycastle.crypto.CryptoException- 加密过程运行异常
-
userCert
public byte[] userCert()用户加密时使用的证书,仅在使用证书加密的加密器中需要实现- Specified by:
userCertin interfaceUserFEKEncryptor- Returns:
- 证书文件字节内容(DER编码),在使用口令加密时可返还null
-
encryptCaseId
加密保护方案标识,见附录 A.1ProtectionCaseID- Specified by:
encryptCaseIdin interfaceUserFEKEncryptor- Returns:
- 加密保护方案标识
-