コード例 #1
0
        /// <summary>
        /// Compare this instance of MRZInfo with another object.
        /// </summary>
        /// <param name="obj">Object to compare with</param>
        /// <returns>True if this instance is equal to the given object or else false.</returns>
        public override bool Equals(Object obj)
        {
            if (obj == this)
            {
                return(true);
            }
            if (obj == null)
            {
                return(false);
            }
            if (!(obj.GetType().Equals(this.GetType())))
            {
                return(false);
            }
            MRZInfo other = (MRZInfo)obj;

            if (documentType != other.documentType)
            {
                return(false);
            }
            if (!issuingState.Equals(other.issuingState))
            {
                return(false);
            }
            if (!primaryIdentifier.Equals(other.primaryIdentifier))
            {
                return(false);
            }
            if (!ArrayEquals(secondaryIdentifiers, other.secondaryIdentifiers))
            {
                return(false);
            }
            if (!nationality.Equals(other.nationality))
            {
                return(false);
            }
            if (!documentNumber.Equals(other.documentNumber))
            {
                return(false);
            }
            if (!personalNumber.Equals(other.personalNumber))
            {
                return(false);
            }
            if (!dateOfBirth.Equals(other.dateOfBirth))
            {
                return(false);
            }
            if (gender != other.gender)
            {
                return(false);
            }
            if (!dateOfExpiry.Equals(other.dateOfExpiry))
            {
                return(false);
            }
            return(true);
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <b>RequestSecurityTokenResponse</b> using the specified
 /// security token request, ppid and MRZ information.
 /// </summary>
 /// <param name="rst"><b>RST</b> to which this instance is a response (RSTR)</param>
 /// <param name="ppid">Identifier of the person requesting the token</param>
 /// <param name="mrz">MRZ information used for constructing this RSTR</param>
 public RequestSecurityTokenResponse(RST rst, string ppid, MRZInfo mrz)
     : base(false)
 {
     this.context = rst.Context;
     this.useKey = rst.UseKey;
     this.keyType = rst.KeyType;
     this.claimTypes = rst.ClaimTypes;
     this.ppid = ppid;
     this.mrz = mrz;
 }
コード例 #3
0
ファイル: DG1File.cs プロジェクト: hernandazevedo/JMRTD
 /// <summary>
 /// Constructs a new EF_DG1 file.
 /// </summary>
 /// <param name="data">bytes of the EF_DG1 file</param>
 public DG1File(byte[] data)
 {
     dgNumber = 1;
     raw = new byte[data.Length];
     Array.Copy(data,RawBytes,data.Length);
     MemoryStream dg1MemStream = new MemoryStream(data);
     BERTLVInputStream dg1Stream = new BERTLVInputStream(dg1MemStream);
     int tag = dg1Stream.readTag();
     if (tag != IDGFile.EF_DG1_TAG) throw new ArgumentException("Expected EF_DG1_TAG");
     int dg1Length = dg1Stream.readLength();
     dg1Stream.skipToTag(MRZ_INFO_TAG);
     dg1Stream.readLength();
     _mrz = new MRZInfo(dg1MemStream);
 }
コード例 #4
0
        /// <summary>
        /// Constructs a new EF_DG1 file.
        /// </summary>
        /// <param name="data">bytes of the EF_DG1 file</param>
        public DG1File(byte[] data)
        {
            dgNumber = 1;
            raw      = new byte[data.Length];
            Array.Copy(data, RawBytes, data.Length);
            MemoryStream      dg1MemStream = new MemoryStream(data);
            BERTLVInputStream dg1Stream    = new BERTLVInputStream(dg1MemStream);
            int tag = dg1Stream.readTag();

            if (tag != IDGFile.EF_DG1_TAG)
            {
                throw new ArgumentException("Expected EF_DG1_TAG");
            }
            int dg1Length = dg1Stream.readLength();

            dg1Stream.skipToTag(MRZ_INFO_TAG);
            dg1Stream.readLength();
            _mrz = new MRZInfo(dg1MemStream);
        }