@Test public void keyShouldModMatchWithTestCrt() throws RsaException { BigInteger crtMod = testCrtReader.getPubModulus(); BigInteger keyMod = testKey.getModulus(); Assert.assertEquals(crtMod, keyMod); Assert.assertEquals(crtMod, testMod); }
public BigInteger getPubModulus() throws RsaException { try { JcaPEMKeyConverter converter = new JcaPEMKeyConverter().setProvider(RsaConst.BC); SubjectPublicKeyInfo pubKeyInfo = x509holder.getSubjectPublicKeyInfo(); BCRSAPublicKey pubKey = (BCRSAPublicKey) converter.getPublicKey(x509holder.getSubjectPublicKeyInfo()); BigInteger pubMod = pubKey.getModulus(); return pubMod; } catch (PEMException ex) { throw new RsaException("Unable to retrieve modulus"); } }
X509Inspector { public BigInteger getPubModulus() throws RsaException { try { JcaPEMKeyConverter converter = new JcaPEMKeyConverter().setProvider(RsaConst.BC); SubjectPublicKeyInfo pubKeyInfo = x509holder.getSubjectPublicKeyInfo(); BCRSAPublicKey pubKey = (BCRSAPublicKey) converter.getPublicKey(x509holder.getSubjectPublicKeyInfo()); BigInteger pubMod = pubKey.getModulus(); return pubMod; } catch (PEMException ex) { throw new RsaException("Unable to retrieve modulus"); } } }
X509Inspector { public BigInteger getPubModulus() throws RsaException { try { JcaPEMKeyConverter converter = new JcaPEMKeyConverter().setProvider(RsaConst.BC); SubjectPublicKeyInfo pubKeyInfo = x509holder.getSubjectPublicKeyInfo(); BCRSAPublicKey pubKey = (BCRSAPublicKey) converter.getPublicKey(x509holder.getSubjectPublicKeyInfo()); BigInteger pubMod = pubKey.getModulus(); return pubMod; } catch (PEMException ex) { throw new RsaException("Unable to retrieve modulus"); } } X509Inspector(X509CertificateHolder x509holder);  X509Inspector(X509Certificate x509); @Deprecated  X509Inspector(X509CertificateObject x509obj); }
X509Inspector { public BigInteger getPubModulus() throws RsaException { try { JcaPEMKeyConverter converter = new JcaPEMKeyConverter().setProvider(RsaConst.BC); SubjectPublicKeyInfo pubKeyInfo = x509holder.getSubjectPublicKeyInfo(); BCRSAPublicKey pubKey = (BCRSAPublicKey) converter.getPublicKey(x509holder.getSubjectPublicKeyInfo()); BigInteger pubMod = pubKey.getModulus(); return pubMod; } catch (PEMException ex) { throw new RsaException("Unable to retrieve modulus"); } } X509Inspector(X509CertificateHolder x509holder);  X509Inspector(X509Certificate x509); @Deprecated  X509Inspector(X509CertificateObject x509obj); X509CertificateHolder getX509CertificateHolder(); static X509Inspector newX509Inspector(X509CertificateHolder xh); static X509Inspector newX509Inspector(String x509PemString); static X509Inspector newX509Inspector(X509Certificate x509Cert); String getIssuerCN(); String getSubjectCN(); URI getOCSPUri(); URI getOCSPCaUri(); String getIssuerName(); String getSubjectName(); X509Certificate getX509Certificate(); BigInteger getPubModulus(); int getPubModulusSize(); BigInteger getSerial(); String getSubjKeyId(); String getAuthKeyId(); BigInteger getAuthKeyIdSerial(); List<String> getAuthKeyIdDirname(); PublicKey getPublicKey(); Calendar getNotBefore(); Calendar getNotAfter(); boolean isExpired(); boolean isPremature(); boolean isExpired(Date date); boolean isPremature(Date date); boolean isDateValid(); boolean isDateValid(Date date); @Deprecated X509CertificateObject getX509CertificateObject(); }
X509Inspector { public BigInteger getPubModulus() throws RsaException { try { JcaPEMKeyConverter converter = new JcaPEMKeyConverter().setProvider(RsaConst.BC); SubjectPublicKeyInfo pubKeyInfo = x509holder.getSubjectPublicKeyInfo(); BCRSAPublicKey pubKey = (BCRSAPublicKey) converter.getPublicKey(x509holder.getSubjectPublicKeyInfo()); BigInteger pubMod = pubKey.getModulus(); return pubMod; } catch (PEMException ex) { throw new RsaException("Unable to retrieve modulus"); } } X509Inspector(X509CertificateHolder x509holder);  X509Inspector(X509Certificate x509); @Deprecated  X509Inspector(X509CertificateObject x509obj); X509CertificateHolder getX509CertificateHolder(); static X509Inspector newX509Inspector(X509CertificateHolder xh); static X509Inspector newX509Inspector(String x509PemString); static X509Inspector newX509Inspector(X509Certificate x509Cert); String getIssuerCN(); String getSubjectCN(); URI getOCSPUri(); URI getOCSPCaUri(); String getIssuerName(); String getSubjectName(); X509Certificate getX509Certificate(); BigInteger getPubModulus(); int getPubModulusSize(); BigInteger getSerial(); String getSubjKeyId(); String getAuthKeyId(); BigInteger getAuthKeyIdSerial(); List<String> getAuthKeyIdDirname(); PublicKey getPublicKey(); Calendar getNotBefore(); Calendar getNotAfter(); boolean isExpired(); boolean isPremature(); boolean isExpired(Date date); boolean isPremature(Date date); boolean isDateValid(); boolean isDateValid(Date date); @Deprecated X509CertificateObject getX509CertificateObject();  }