1 package club.wpia.gigi.crypto.key;
3 import java.security.PublicKey;
4 import java.security.interfaces.DSAPublicKey;
5 import java.security.interfaces.ECPublicKey;
6 import java.security.interfaces.RSAPublicKey;
8 import club.wpia.gigi.GigiApiException;
9 import club.wpia.gigi.output.template.SprintfCommand;
11 public class KeyCheckPublicKeyFormat extends KeyCheck {
14 register(new KeyCheckPublicKeyFormat());
18 public void check(PublicKey key) throws GigiApiException {
20 if (key instanceof RSAPublicKey) {
24 if (key instanceof DSAPublicKey) {
28 if (key instanceof ECPublicKey) {
32 throw new GigiApiException(SprintfCommand.createSimple("Public Key Format Check: Unknown or unsupported public key algorithm {0}", key.getAlgorithm()));