Search in sources :

Example 1 with GMSSPublicKeySpec

use of de.flexiprovider.pqc.hbc.gmss.GMSSPublicKeySpec in project core by jcryptool.

the class GMSSPublicKeyContentProvider method getKeySpecElements.

@Override
protected List<TableEntry> getKeySpecElements(Key key) {
    List<TableEntry> paramElements = new ArrayList<TableEntry>();
    try {
        GMSSKeyFactory keyFactory = new GMSSKeyFactory();
        GMSSPublicKeySpec keySpec = (GMSSPublicKeySpec) keyFactory.getKeySpec(key, GMSSPublicKeySpec.class);
        if (keySpec == null)
            return null;
        paramElements.add(new TableEntry(Messages.ContentProvider_publickey, // $NON-NLS-2$
        "" + Arrays.toString(keySpec.getPublicKey())));
        paramElements.addAll(getParameters(keySpec));
    } catch (ClassCastException e) {
        return null;
    } catch (InvalidKeySpecException e) {
        return null;
    }
    return paramElements;
}
Also used : TableEntry(org.jcryptool.crypto.keystore.ui.dialogs.TableEntry) GMSSKeyFactory(de.flexiprovider.pqc.hbc.gmss.GMSSKeyFactory) ArrayList(java.util.ArrayList) InvalidKeySpecException(de.flexiprovider.api.exceptions.InvalidKeySpecException) GMSSPublicKeySpec(de.flexiprovider.pqc.hbc.gmss.GMSSPublicKeySpec)

Aggregations

InvalidKeySpecException (de.flexiprovider.api.exceptions.InvalidKeySpecException)1 GMSSKeyFactory (de.flexiprovider.pqc.hbc.gmss.GMSSKeyFactory)1 GMSSPublicKeySpec (de.flexiprovider.pqc.hbc.gmss.GMSSPublicKeySpec)1 ArrayList (java.util.ArrayList)1 TableEntry (org.jcryptool.crypto.keystore.ui.dialogs.TableEntry)1