Search in sources :

Example 6 with SignerStub

use of org.apache.harmony.security.tests.support.SignerStub in project robovm by robovm.

the class SignerTest method test_toString.

/**
     * java.security.Signer#toString()
     */
public void test_toString() throws Exception {
    Signer s1 = new SignerStub("testToString1");
    assertEquals("[Signer]testToString1", s1.toString());
    Signer s2 = new SignerStub("testToString2", IdentityScope.getSystemScope());
    s2.toString();
    KeyPair kp = new KeyPair(new PublicKeyStub("public", "SignerTest.testToString", null), new PrivateKeyStub("private", "SignerTest.testToString", null));
    s1.setKeyPair(kp);
    s1.toString();
    s2.setKeyPair(kp);
    s2.toString();
}
Also used : Signer(java.security.Signer) KeyPair(java.security.KeyPair) PrivateKeyStub(org.apache.harmony.security.tests.support.PrivateKeyStub) SignerStub(org.apache.harmony.security.tests.support.SignerStub) PublicKeyStub(org.apache.harmony.security.tests.support.PublicKeyStub)

Aggregations

SignerStub (org.apache.harmony.security.tests.support.SignerStub)6 Signer (java.security.Signer)5 KeyPair (java.security.KeyPair)3 PrivateKeyStub (org.apache.harmony.security.tests.support.PrivateKeyStub)2 PublicKeyStub (org.apache.harmony.security.tests.support.PublicKeyStub)2 InvalidParameterException (java.security.InvalidParameterException)1 KeyManagementException (java.security.KeyManagementException)1