use of de.flexiprovider.pqc.ots.merkle.MerkleOTSPublicKeySpec in project core by jcryptool.
the class MerkleOTSPublicKeyContentProvider method getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
MerkleOTSKeyFactory keyFactory = new MerkleOTSKeyFactory();
MerkleOTSPublicKeySpec keySpec = (MerkleOTSPublicKeySpec) keyFactory.getKeySpec(key, MerkleOTSPublicKeySpec.class);
if (keySpec == null)
return null;
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_oidstring, "" + keySpec.getOIDString()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_keybytes, "" + keySpec.getKeyBytes()));
} catch (ClassCastException e) {
return null;
} catch (InvalidKeySpecException e) {
return null;
}
return paramElements;
}
Aggregations