FileDocCategorySizeDatePackage
ShowKey.javaAPI DocExample526Mon Feb 23 16:28:50 GMT 1998None

ShowKey.java

import java.security.*;
import java.util.*;

public class ShowKey {
  public static void main(String[] args) {
    if (args.length < 1) {
      System.out.println("Usage: ShowKey name");
      return;
    }

    IdentityScope systemScope = IdentityScope.getSystemScope();
    Identity i = systemScope.getIdentity(args[0]);
    Key k = i.getPublicKey();
    if (k != null) {
      System.out.println("  Public key uses " + k.getAlgorithm() +
          " and is encoded by " + k.getFormat() + ".");
    }
  }
}