final KeyMetadata destMetadata = destinationKeyczar.getMetadata();
final GenericKeyczar sourceKeyczar =
getImportingKeyczar(pemFileFlag, paddingFlag, passphraseFlag, destMetadata.getPurpose());
// Change destination type if necessary, but only if there aren't any keys in it yet.
final KeyType sourceKeyType = sourceKeyczar.getMetadata().getType();
if (destMetadata.getType() != sourceKeyType
&& destinationKeyczar.getVersions().isEmpty()) {
destMetadata.setType(sourceKeyType);
}