Examples of SignatureDSA


Examples of org.apache.sshd.common.signature.SignatureDSA

            throw new SshException("Key not found");
        }
        try {
            Signature verif;
            if (kp.getFirst().getPublic() instanceof DSAPublicKey) {
                verif = new SignatureDSA();
            } else if (kp.getFirst().getPublic() instanceof ECPublicKey) {
                ECPublicKey pubKey = (ECPublicKey) kp.getFirst().getPublic();
                verif = SignatureECDSA.getByCurveSize(pubKey.getParams());
            } else if (kp.getFirst().getPublic() instanceof RSAPublicKey) {
                verif = new SignatureRSA();
View Full Code Here

Examples of org.apache.sshd.common.signature.SignatureDSA

        try {
            Signature verif;
            if (kp.getFirst().getPublic() instanceof RSAPublicKey) {
                verif = new SignatureRSA();
            } else {
                verif = new SignatureDSA();
            }
            verif.init(kp.getFirst().getPublic(), kp.getFirst().getPrivate());
            verif.update(data, 0, data.length);
            return verif.sign();
        } catch (IOException e) {
View Full Code Here

Examples of org.apache.sshd.common.signature.SignatureDSA

        try {
            Signature verif;
            if (kp.getFirst().getPublic() instanceof RSAPublicKey) {
                verif = new SignatureRSA();
            } else {
                verif = new SignatureDSA();
            }
            verif.init(kp.getFirst().getPublic(), kp.getFirst().getPrivate());
            verif.update(data, 0, data.length);
            return verif.sign();
        } catch (IOException e) {
View Full Code Here

Examples of org.vngx.jsch.algorithm.SignatureDSA

      byte[] q = hostKeyBuffer.getMPInt()// impint q of dsa
      byte[] g = hostKeyBuffer.getMPInt()// impint g of dsa
      byte[] y = hostKeyBuffer.getMPInt()// impint public key of dsa

      // Create SignatureDSA instance for verifying server host
      SignatureDSA sig = AlgorithmManager.getManager().createAlgorithm(Algorithms.SIGNATURE_DSS, _session);
      sig.setPubKey(y, p, q, g);
      sig.update(_H);
      return sig.verify(signatureOfH);
    } catch(Exception e) {
      throw new KexException("Failed to verify host key (DSA)", e);
    }
  }
View Full Code Here

Examples of org.vngx.jsch.algorithm.SignatureDSA

        }
        return null;
      }
      case SSH_DSS: {
        try {
          SignatureDSA dsa = AlgorithmManager.getManager().createAlgorithm(Algorithms.SIGNATURE_DSS);
          dsa.setPrvKey(_prvKeyDSA, _pDSA, _qDSA, _gDSA);
          dsa.update(data);
          byte[] sig = dsa.sign();
          byte[] buffer = new byte[KeyType.SSH_DSS.toString().length() + 4 + sig.length + 4];
          Buffer buf = new Buffer(buffer);
          buf.putString(KeyType.SSH_DSS.getBytes());
          buf.putString(sig);
          return buffer;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.