Examples of DSSKeyPairRawCodec


Examples of gnu.java.security.key.dss.DSSKeyPairRawCodec

  {
    harness.checkPoint("testKeyPairRawCodec");

    kp = kpg.generate();

    IKeyPairCodec codec = new DSSKeyPairRawCodec();
    byte[] pk;

    DSAPublicKey pubK = (DSAPublicKey) kp.getPublic();
    pk = ((DSSPublicKey) pubK).getEncoded(IKeyPairCodec.RAW_FORMAT);
    PublicKey newPubK = codec.decodePublicKey(pk);
    harness.check(pubK.equals(newPubK),
                  "DSS public key Raw encoder/decoder test");

    DSAPrivateKey secK = (DSAPrivateKey) kp.getPrivate();
    pk = ((DSSPrivateKey) secK).getEncoded(IKeyPairCodec.RAW_FORMAT);
    PrivateKey newSecK = codec.decodePrivateKey(pk);
    harness.check(secK.equals(newSecK),
                  "DSS private key Raw encoder/decoder test");
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.