Lines Matching refs:key

48     static int checkRSA(RSAPublicKey key, boolean useSHA256) throws Exception {  in checkRSA()  argument
49 BigInteger pubexp = key.getPublicExponent(); in checkRSA()
50 BigInteger modulus = key.getModulus(); in checkRSA()
76 static int checkEC(ECPublicKey key) throws Exception { in checkEC() argument
77 if (key.getParams().getCurve().getField().getFieldSize() != 256) { in checkEC()
87 static int check(PublicKey key, boolean useSHA256) throws Exception { in check() argument
88 if (key instanceof RSAPublicKey) { in check()
89 return checkRSA((RSAPublicKey) key, useSHA256); in check()
90 } else if (key instanceof ECPublicKey) { in check()
94 return checkEC((ECPublicKey) key); in check()
96 throw new Exception("Unsupported key class: " + key.getClass().getName()); in check()
106 static String printRSA(RSAPublicKey key, boolean useSHA256) throws Exception { in printRSA() argument
107 int version = check(key, useSHA256); in printRSA()
109 BigInteger N = key.getModulus(); in printRSA()
171 static String printEC(ECPublicKey key) throws Exception { in printEC() argument
172 int version = checkEC(key); in printEC()
180 BigInteger X = key.getW().getAffineX(); in printEC()
181 BigInteger Y = key.getW().getAffineY(); in printEC()
182 …int nbytes = key.getParams().getCurve().getField().getFieldSize() / 8; // # of 32 bit integers … in printEC()
221 static String print(PublicKey key, boolean useSHA256) throws Exception { in print() argument
222 if (key instanceof RSAPublicKey) { in print()
223 return printRSA((RSAPublicKey) key, useSHA256); in print()
224 } else if (key instanceof ECPublicKey) { in print()
225 return printEC((ECPublicKey) key); in print()
227 throw new Exception("Unsupported key class: " + key.getClass().getName()); in print()
259 PublicKey key = cert.getPublicKey(); in main() local
260 check(key, useSHA256); in main()
261 System.out.print(print(key, useSHA256)); in main()