コード例 #1
0
        public byte[] GetSignature()
        {
            MPInteger[] sigValues = sigPck.GetSignature();
            byte[]      signature;

            if (sigValues != null)
            {
                if (sigValues.Length == 1)                    // an RSA signature
                {
                    signature = sigValues[0].Value.ToByteArrayUnsigned();
                }
                else
                {
                    try
                    {
                        signature = new DerSequence(
                            new DerInteger(sigValues[0].Value),
                            new DerInteger(sigValues[1].Value)).GetEncoded();
                    }
                    catch (IOException e)
                    {
                        throw new PgpException("exception encoding DSA sig.", e);
                    }
                }
            }
            else
            {
                signature = sigPck.GetSignatureBytes();
            }

            return(signature);
        }
コード例 #2
0
 public byte[] GetSignature()
 {
     MPInteger[] signature = sigPck.GetSignature();
     if (signature != null)
     {
         if (signature.Length == 1)
         {
             return(signature[0].Value.ToByteArrayUnsigned());
         }
         try
         {
             return(new DerSequence(new DerInteger(signature[0].Value), new DerInteger(signature[1].Value)).GetEncoded());
         }
         catch (IOException exception)
         {
             throw new PgpException("exception encoding DSA sig.", exception);
         }
     }
     return(sigPck.GetSignatureBytes());
 }
コード例 #3
0
 public byte[] GetSignature()
 {
     //IL_005b: Expected O, but got Unknown
     MPInteger[] signature = sigPck.GetSignature();
     if (signature != null)
     {
         if (signature.Length == 1)
         {
             return(signature[0].Value.ToByteArrayUnsigned());
         }
         try
         {
             return(new DerSequence(new DerInteger(signature[0].Value), new DerInteger(signature[1].Value)).GetEncoded());
         }
         catch (IOException val)
         {
             IOException exception = val;
             throw new PgpException("exception encoding DSA sig.", (global::System.Exception)(object) exception);
         }
     }
     return(sigPck.GetSignatureBytes());
 }