@Test public void x25519() { CertificateToken token = DSSUtils.loadCertificateFromBase64EncodedString( "MIIBLDCB36ADAgECAghWAUdKKo3DMDAFBgMrZXAwGTEXMBUGA1UEAwwOSUVURiBUZXN0IERlbW8wHhcNMTYwODAxMTIxOTI0WhcNNDAxMjMxMjM1OTU5WjAZMRcwFQYDVQQDDA5JRVRGIFRlc3QgRGVtbzAqMAUGAytlbgMhAIUg8AmJMKdUdIt93LQ+91oNvzoNJjga9OukqY6qm05qo0UwQzAPBgNVHRMBAf8EBTADAQEAMA4GA1UdDwEBAAQEAwIDCDAgBgNVHQ4BAQAEFgQUmx9e7e0EM4Xk97xiPFl1uQvIuzswBQYDK2VwA0EAryMB/t3J5v/BzKc9dNZIpDmAgs3babFOTQbs+BolzlDUwsPrdGxO3YNGhW7Ibz3OGhhlxXrCe1Cgw1AH9efZBw=="); assertEquals(EncryptionAlgorithm.X25519, EncryptionAlgorithm.forKey(token.getPublicKey())); assertEquals(32, DSSPKUtils.getPublicKeySize(token.getPublicKey())); assertTrue(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);  }