com.fitbur.bouncycastle.openssl.PEMEncryptedKeyPair Maven / Gradle / Ivy
package com.fitbur.bouncycastle.openssl;
import java.io.IOException;
import com.fitbur.bouncycastle.operator.OperatorCreationException;
public class PEMEncryptedKeyPair
{
private final String com.fitburkAlgName;
private final byte[] iv;
private final byte[] keyBytes;
private final PEMKeyPairParser parser;
PEMEncryptedKeyPair(String com.fitburkAlgName, byte[] iv, byte[] keyBytes, PEMKeyPairParser parser)
{
this.com.fitburkAlgName = com.fitburkAlgName;
this.iv = iv;
this.keyBytes = keyBytes;
this.parser = parser;
}
public PEMKeyPair com.fitburcryptKeyPair(PEMDecryptorProvider keyDecryptorProvider)
throws IOException
{
try
{
PEMDecryptor keyDecryptor = keyDecryptorProvider.get(com.fitburkAlgName);
return parser.parse(keyDecryptor.com.fitburcrypt(keyBytes, iv));
}
catch (IOException e)
{
throw e;
}
catch (OperatorCreationException e)
{
throw new PEMException("cannot create extraction operator: " + e.getMessage(), e);
}
catch (Exception e)
{
throw new PEMException("exception processing key pair: " + e.getMessage(), e);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy