use of de.flexiprovider.api.exceptions.InvalidKeySpecException in project core by jcryptool.
the class SSVElGamalPublicKeyContentProvider method getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
SSVElGamalKeyFactory keyFactory = new SSVElGamalKeyFactory();
SSVElGamalPublicKeySpec keySpec = (SSVElGamalPublicKeySpec) keyFactory.getKeySpec(key, SSVElGamalPublicKeySpec.class);
if (keySpec == null)
return null;
} catch (ClassCastException e) {
return null;
} catch (InvalidKeySpecException e) {
return null;
}
return paramElements;
}
use of de.flexiprovider.api.exceptions.InvalidKeySpecException in project core by jcryptool.
the class PBESecretKeyContentProvider method getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
PBEKeyFactory keyFactory = new PBEKeyFactory();
PBEKeySpec keySpec = (PBEKeySpec) keyFactory.getKeySpec((SecretKey) key, PBEKeySpec.class);
if (keySpec == null)
return null;
paramElements.add(// $NON-NLS-2$
new TableEntry(Messages.ContentProvider_iterationcount, "" + keySpec.getIterationCount()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_keylength, "" + keySpec.getKeyLength()));
paramElements.add(new TableEntry(Messages.ContentProvider_password, // $NON-NLS-2$
"" + Arrays.toString(keySpec.getPassword())));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_salt, "" + Arrays.toString(keySpec.getSalt())));
} catch (ClassCastException e) {
return null;
} catch (InvalidKeySpecException e) {
return null;
}
return paramElements;
}
use of de.flexiprovider.api.exceptions.InvalidKeySpecException in project core by jcryptool.
the class McElieceCCA2PublicKeyContentProvider method getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
McElieceCCA2KeyFactory keyFactory = new McElieceCCA2KeyFactory();
McElieceCCA2PublicKeySpec keySpec = (McElieceCCA2PublicKeySpec) keyFactory.getKeySpec(key, McElieceCCA2PublicKeySpec.class);
if (keySpec == null)
return null;
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_n, "" + keySpec.getN()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_t, "" + keySpec.getT()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_matrixg, "" + keySpec.getMatrixG()));
} catch (ClassCastException e) {
return null;
} catch (InvalidKeySpecException e) {
return null;
}
return paramElements;
}
use of de.flexiprovider.api.exceptions.InvalidKeySpecException in project core by jcryptool.
the class McEliecePublicKeyContentProvider method getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
McElieceKeyFactory keyFactory = new McElieceKeyFactory();
McEliecePublicKeySpec keySpec = (McEliecePublicKeySpec) keyFactory.getKeySpec(key, McEliecePublicKeySpec.class);
if (keySpec == null)
return null;
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_n, "" + keySpec.getN()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_t, "" + keySpec.getT()));
// $NON-NLS-2$
paramElements.add(new TableEntry(Messages.ContentProvider_g, "" + keySpec.getG()));
} catch (ClassCastException e) {
return null;
} catch (InvalidKeySpecException e) {
return null;
}
return paramElements;
}
use of de.flexiprovider.api.exceptions.InvalidKeySpecException in project core by jcryptool.
the class MerkleOTSPrivateKeyContentProvider method getKeySpecElements.
@Override
protected List<TableEntry> getKeySpecElements(Key key) {
List<TableEntry> paramElements = new ArrayList<TableEntry>();
try {
MerkleOTSKeyFactory keyFactory = new MerkleOTSKeyFactory();
MerkleOTSPrivateKeySpec keySpec = (MerkleOTSPrivateKeySpec) keyFactory.getKeySpec(key, MerkleOTSPrivateKeySpec.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