@Test public void Ed25519() { CertificateToken token = DSSUtils.loadCertificateFromBase64EncodedString( "MIIBCDCBuwIUGW78zw0OL0GptJi++a91dBa7DsQwBQYDK2VwMCcxCzAJBgNVBAYTAkRFMRgwFgYDVQQDDA93d3cuZXhhbXBsZS5jb20wHhcNMTkwMzMxMTc1MTIyWhcNMjEwMjI4MTc1MTIyWjAnMQswCQYDVQQGEwJERTEYMBYGA1UEAwwPd3d3LmV4YW1wbGUuY29tMCowBQYDK2VwAyEAK87g0b8CC1eA5mvKXt9uezZwJYWEyg74Y0xTZEkqCcwwBQYDK2VwA0EAIIu/aa3Qtr3IE5to/nvWVY9y3ciwG5DnA70X3ALUhFs+U5aLtfY8sNT1Ng72ht+UBwByuze20UsL9qMsmknQCA=="); assertNotNull(token); assertEquals(EncryptionAlgorithm.ED25519, EncryptionAlgorithm.forKey(token.getPublicKey())); assertEquals(32, DSSPKUtils.getPublicKeySize(token.getPublicKey())); assertFalse(token.checkKeyUsage(KeyUsageBit.KEY_AGREEMENT)); }
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);  }