public static P11RSAKeyParameter getInstance(P11CryptService p11CryptService, P11IdentityId identityId) throws InvalidKeyException { ParamUtil.requireNonNull("p11CryptService", p11CryptService); ParamUtil.requireNonNull("identityId", identityId); RSAPublicKey key; try { key = (RSAPublicKey) p11CryptService.getIdentity(identityId).getPublicKey(); } catch (P11TokenException ex) { throw new InvalidKeyException(ex.getMessage(), ex); } BigInteger modulus = key.getModulus(); BigInteger publicExponent = key.getPublicExponent(); return new P11RSAKeyParameter(p11CryptService, identityId, modulus, publicExponent); }
public static P11RSAKeyParameter getInstance(P11CryptService p11CryptService, P11IdentityId identityId) throws InvalidKeyException { Args.notNull(p11CryptService, "p11CryptService"); Args.notNull(identityId, "identityId"); RSAPublicKey key; try { key = (RSAPublicKey) p11CryptService.getIdentity(identityId).getPublicKey(); } catch (P11TokenException ex) { throw new InvalidKeyException(ex.getMessage(), ex); } BigInteger modulus = key.getModulus(); BigInteger publicExponent = key.getPublicExponent(); return new P11RSAKeyParameter(p11CryptService, identityId, modulus, publicExponent); }
public static P11RSAKeyParameter getInstance(final P11CryptService p11CryptService, final P11EntityIdentifier identityId) throws InvalidKeyException { ParamUtil.requireNonNull("p11CryptService", p11CryptService); ParamUtil.requireNonNull("identityId", identityId); RSAPublicKey key; try { key = (RSAPublicKey) p11CryptService.getIdentity(identityId).publicKey(); } catch (P11TokenException ex) { throw new InvalidKeyException(ex.getMessage(), ex); } BigInteger modulus = key.getModulus(); BigInteger publicExponent = key.getPublicExponent(); return new P11RSAKeyParameter(p11CryptService, identityId, modulus, publicExponent); }