use of java.security.spec.DSAParameterSpec in project Bytecoder by mirkosertic.
the class DSAPrivateKey method getParams.
/**
* Returns the DSA parameters associated with this key, or null if the
* parameters could not be parsed.
*/
public DSAParams getParams() {
try {
if (algid instanceof DSAParams) {
return (DSAParams) algid;
} else {
DSAParameterSpec paramSpec;
AlgorithmParameters algParams = algid.getParameters();
if (algParams == null) {
return null;
}
paramSpec = algParams.getParameterSpec(DSAParameterSpec.class);
return (DSAParams) paramSpec;
}
} catch (InvalidParameterSpecException e) {
return null;
}
}
use of java.security.spec.DSAParameterSpec in project Bytecoder by mirkosertic.
the class DSAPublicKey method getParams.
/**
* Returns the DSA parameters associated with this key, or null if the
* parameters could not be parsed.
*/
public DSAParams getParams() {
try {
if (algid instanceof DSAParams) {
return (DSAParams) algid;
} else {
DSAParameterSpec paramSpec;
AlgorithmParameters algParams = algid.getParameters();
if (algParams == null) {
return null;
}
paramSpec = algParams.getParameterSpec(DSAParameterSpec.class);
return (DSAParams) paramSpec;
}
} catch (InvalidParameterSpecException e) {
return null;
}
}
use of java.security.spec.DSAParameterSpec in project j2objc by google.
the class DSAParameterSpecTest method testGetP.
/**
* getP() test
*/
public final void testGetP() {
DSAParameterSpec dps = new DSAParameterSpec(new BigInteger("1"), new BigInteger("2"), new BigInteger("3"));
assertEquals(1, dps.getP().intValue());
}
use of java.security.spec.DSAParameterSpec in project j2objc by google.
the class DSAParameterSpecTest method testGetQ.
/**
* getQ() test
*/
public final void testGetQ() {
DSAParameterSpec dps = new DSAParameterSpec(new BigInteger("1"), new BigInteger("2"), new BigInteger("3"));
assertEquals(2, dps.getQ().intValue());
}
use of java.security.spec.DSAParameterSpec in project j2objc by google.
the class DSAParameterSpecTest method testGetG.
/**
* getG() test
*/
public final void testGetG() {
DSAParameterSpec dps = new DSAParameterSpec(new BigInteger("1"), new BigInteger("2"), new BigInteger("3"));
assertEquals(3, dps.getG().intValue());
}
Aggregations