示例#1
0
        /// <summary>
        /// Returns a hashcode value for this CRL from its
        /// encoded form.
        /// </summary>
        /// <returns> the hashcode value. </returns>
        public override int HashCode()
        {
            int retval = 0;

            try
            {
                sbyte[] crlData = X509CRLImpl.getEncodedInternal(this);
                for (int i = 1; i < crlData.Length; i++)
                {
                    retval += crlData[i] * i;
                }
                return(retval);
            }
            catch (CRLException)
            {
                return(retval);
            }
        }
示例#2
0
        /// <summary>
        /// Compares this CRL for equality with the given
        /// object. If the {@code other} object is an
        /// {@code instanceof} {@code X509CRL}, then
        /// its encoded form is retrieved and compared with the
        /// encoded form of this CRL.
        /// </summary>
        /// <param name="other"> the object to test for equality with this CRL.
        /// </param>
        /// <returns> true iff the encoded forms of the two CRLs
        /// match, false otherwise. </returns>
        public override bool Equals(Object other)
        {
            if (this == other)
            {
                return(true);
            }
            if (!(other is X509CRL))
            {
                return(false);
            }
            try
            {
                sbyte[] thisCRL  = X509CRLImpl.getEncodedInternal(this);
                sbyte[] otherCRL = X509CRLImpl.getEncodedInternal((X509CRL)other);

                return(Arrays.Equals(thisCRL, otherCRL));
            }
            catch (CRLException)
            {
                return(false);
            }
        }
示例#3
0
        /// <summary>
        /// Verifies that this CRL was signed using the
        /// private key that corresponds to the given public key.
        /// This method uses the signature verification engine
        /// supplied by the given provider. Note that the specified Provider object
        /// does not have to be registered in the provider list.
        ///
        /// This method was added to version 1.8 of the Java Platform Standard
        /// Edition. In order to maintain backwards compatibility with existing
        /// service providers, this method is not {@code abstract}
        /// and it provides a default implementation.
        /// </summary>
        /// <param name="key"> the PublicKey used to carry out the verification. </param>
        /// <param name="sigProvider"> the signature provider.
        /// </param>
        /// <exception cref="NoSuchAlgorithmException"> on unsupported signature
        /// algorithms. </exception>
        /// <exception cref="InvalidKeyException"> on incorrect key. </exception>
        /// <exception cref="SignatureException"> on signature errors. </exception>
        /// <exception cref="CRLException"> on encoding errors.
        /// @since 1.8 </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void verify(java.security.PublicKey key, java.security.Provider sigProvider) throws CRLException, java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.security.SignatureException
        public virtual void Verify(PublicKey key, Provider sigProvider)
        {
            X509CRLImpl.verify(this, key, sigProvider);
        }