Examples of SignatureRSA


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

                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();
            } else {
                throw new SshException("Unsupported key type");
            }
            verif.init(kp.getFirst().getPublic(), kp.getFirst().getPrivate());
            verif.update(data, 0, data.length);
View Full Code Here

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

            throw new SshException("Key not found");
        }
        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);
View Full Code Here

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

            throw new SshException("Key not found");
        }
        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);
View Full Code Here

Examples of org.vngx.jsch.algorithm.SignatureRSA

    try {
      byte[] ee = hostKeyBuffer.getMPInt();
      byte[] n = hostKeyBuffer.getMPInt();

      // Create SignatureRSA instance for verifying server host
      SignatureRSA sig = AlgorithmManager.getManager().createAlgorithm(Algorithms.SIGNATURE_RSA, _session);
      sig.setPubKey(ee, n);
      sig.update(_H);
      return sig.verify(signatureOfH);
    } catch(Exception e) {
      throw new KexException("Failed to verify host key (RSA)", e);
    }
  }
View Full Code Here

Examples of org.vngx.jsch.algorithm.SignatureRSA

  @Override
  public byte[] getSignature(byte[] data) {
    switch( _keyType ) {
      case SSH_RSA: {
        try {
          SignatureRSA rsa = AlgorithmManager.getManager().createAlgorithm(Algorithms.SIGNATURE_RSA);
          rsa.setPrvKey(_dRSA, _nRSA);
          rsa.update(data);
          byte[] sig = rsa.sign();
          byte[] buffer = new byte[KeyType.SSH_RSA.toString().length() + 4 + sig.length + 4];
          Buffer buf = new Buffer(buffer);
          buf.putString(KeyType.SSH_RSA.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.