use of org.apache.hadoop.hdds.security.x509.keys.HDDSKeyGenerator in project ozone by apache.
the class DefaultCertificateClient method createKeyPair.
protected KeyPair createKeyPair() throws CertificateException {
HDDSKeyGenerator keyGenerator = new HDDSKeyGenerator(securityConfig);
KeyPair keyPair = null;
try {
keyPair = keyGenerator.generateKey();
keyCodec.writePublicKey(keyPair.getPublic());
keyCodec.writePrivateKey(keyPair.getPrivate());
} catch (NoSuchProviderException | NoSuchAlgorithmException | IOException e) {
getLogger().error("Error while bootstrapping certificate client.", e);
throw new CertificateException("Error while bootstrapping certificate.", BOOTSTRAP_ERROR);
}
return keyPair;
}
Aggregations