@Test public void getPublicKeySize() { CertificateToken certificate = DSSUtils.loadCertificate(new File("src/test/resources/BA-QC-Wurzel-CA-2_PN.txt")); assertEquals(2048, DSSPKUtils.getPublicKeySize(certificate.getPublicKey())); assertEquals("2048", DSSPKUtils.getPublicKeySize(certificate)); }
public static String getPublicKeySize(Token token) { String keyLength = "?"; PublicKey issuerPublicKey = null; if (token.getPublicKeyOfTheSigner() != null) { issuerPublicKey = token.getPublicKeyOfTheSigner(); } else if (token.isSelfSigned()) { issuerPublicKey = ((CertificateToken) token).getPublicKey(); } if (issuerPublicKey != null) { keyLength = String.valueOf(getPublicKeySize(issuerPublicKey)); } return keyLength; }
DSSPKUtils { public static String getPublicKeySize(Token token) { String keyLength = "?"; PublicKey issuerPublicKey = null; if (token.getPublicKeyOfTheSigner() != null) { issuerPublicKey = token.getPublicKeyOfTheSigner(); } else if (token.isSelfSigned()) { issuerPublicKey = ((CertificateToken) token).getPublicKey(); } if (issuerPublicKey != null) { keyLength = String.valueOf(getPublicKeySize(issuerPublicKey)); } return keyLength; } }
DSSPKUtils { public static String getPublicKeySize(Token token) { String keyLength = "?"; PublicKey issuerPublicKey = null; if (token.getPublicKeyOfTheSigner() != null) { issuerPublicKey = token.getPublicKeyOfTheSigner(); } else if (token.isSelfSigned()) { issuerPublicKey = ((CertificateToken) token).getPublicKey(); } if (issuerPublicKey != null) { keyLength = String.valueOf(getPublicKeySize(issuerPublicKey)); } return keyLength; } private  DSSPKUtils(); }
DSSPKUtils { public static String getPublicKeySize(Token token) { String keyLength = "?"; PublicKey issuerPublicKey = null; if (token.getPublicKeyOfTheSigner() != null) { issuerPublicKey = token.getPublicKeyOfTheSigner(); } else if (token.isSelfSigned()) { issuerPublicKey = ((CertificateToken) token).getPublicKey(); } if (issuerPublicKey != null) { keyLength = String.valueOf(getPublicKeySize(issuerPublicKey)); } return keyLength; } private  DSSPKUtils(); static String getPublicKeySize(Token token); static int getPublicKeySize(final PublicKey publicKey); }
DSSPKUtils { public static String getPublicKeySize(Token token) { String keyLength = "?"; PublicKey issuerPublicKey = null; if (token.getPublicKeyOfTheSigner() != null) { issuerPublicKey = token.getPublicKeyOfTheSigner(); } else if (token.isSelfSigned()) { issuerPublicKey = ((CertificateToken) token).getPublicKey(); } if (issuerPublicKey != null) { keyLength = String.valueOf(getPublicKeySize(issuerPublicKey)); } return keyLength; } private  DSSPKUtils(); static String getPublicKeySize(Token token); static int getPublicKeySize(final PublicKey publicKey);  }