KeyDescriptorType keyDescriptor = new KeyDescriptorType();
if (isNotNull(algorithm)) {
EncryptionMethodType encryptionMethod = new EncryptionMethodType(algorithm);
encryptionMethod.setEncryptionMethod(new EncryptionMethod(BigInteger.valueOf(keySize), null));
keyDescriptor.addEncryptionMethod(encryptionMethod);
}
keyDescriptor.setKeyInfo(keyInfo);