new BigInteger(dsaKeyValue.getG()) );
try {
KeyFactory fac = KeyFactory.getInstance("DSA");
return fac.generatePublic(spec);
} catch (Exception ex) {
throw new KeyException(ex);
}
} else if ( o instanceof RSAKeyValue) {
RSAKeyValue rsaKayValue = (RSAKeyValue) o;
RSAPublicKeySpec spec = new RSAPublicKeySpec(
new BigInteger(rsaKayValue.getModulus()),
new BigInteger(rsaKayValue.getExponent()));
try {
KeyFactory fac = KeyFactory.getInstance("RSA");
return fac.generatePublic(spec);
} catch (Exception ex) {
throw new KeyException(ex);
}
}
}
return null;
}