com.biuqu.encryptor.impl.PgpEncryptor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bq-encryptor Show documentation
Show all versions of bq-encryptor Show documentation
easy use for mostly encryption
The newest version!
package com.biuqu.encryptor.impl;
import com.biuqu.encryption.factory.EncryptionFactory;
import com.biuqu.encryption.impl.PgpEncryption;
import com.biuqu.encryptor.BaseMultiEncryptor;
import com.biuqu.encryptor.model.EncryptorKey;
import org.bouncycastle.openpgp.PGPSecretKey;
import org.bouncycastle.util.encoders.Hex;
/**
* PGP加密器
*
* @author BiuQu
* @date 2023/5/3 01:12
*/
public class PgpEncryptor extends BaseMultiEncryptor
{
public PgpEncryptor(EncryptorKey key)
{
super(EncryptionFactory.PGP.createAlgorithm(), Hex.decode(key.getPri()), Hex.decode(key.getPub()));
PgpEncryption encryption = (PgpEncryption)this.getEncryption();
encryption.setPwd(key.getPwd().toCharArray());
encryption.setKid(key.getKid());
encryption.setExpire(key.getExpire());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy