dlech.SshAgentLib.ISshKeyExt.GetSigner C# (CSharp) Метод

GetSigner() публичный статический Метод

public static GetSigner ( this key ) : ISigner
key this
Результат ISigner
        public static ISigner GetSigner(this ISshKey key)
        {
            AsymmetricKeyParameter publicKey = key.GetPublicKeyParameters();
              if (publicKey is DsaPublicKeyParameters) {
            return SignerUtilities.GetSigner(X9ObjectIdentifiers.IdDsaWithSha1);
              } else if (publicKey is RsaKeyParameters) {
            return SignerUtilities.GetSigner(PkcsObjectIdentifiers.Sha1WithRsaEncryption);
              } else if (publicKey is ECPublicKeyParameters) {
            int ecdsaFieldSize =
             ((ECPublicKeyParameters)publicKey).Q.Curve.FieldSize;
            if (ecdsaFieldSize <= 256) {
              return SignerUtilities.GetSigner(X9ObjectIdentifiers.ECDsaWithSha256);
            } else if (ecdsaFieldSize > 256 && ecdsaFieldSize <= 384) {
              return SignerUtilities.GetSigner(X9ObjectIdentifiers.ECDsaWithSha384);
            } else if (ecdsaFieldSize > 384) {
              return SignerUtilities.GetSigner(X9ObjectIdentifiers.ECDsaWithSha512);
            }
              } else if (publicKey is Ed25519PublicKeyParameter) {
              return new Ed25519Signer();
              }
              throw new Exception("Unsupported algorithm");
        }