private void DoOutput(MemoryStream bOut)
        {
            OidTokenizer tok = new OidTokenizer(identifier);

            string token = tok.NextToken();
            int    first = int.Parse(token) * 40;

            token = tok.NextToken();
            if (token.Length <= 18)
            {
                WriteField(bOut, first + Int64.Parse(token));
            }
            else
            {
                WriteField(bOut, new BigInteger(token).Add(BigInteger.ValueOf(first)));
            }

            while (tok.HasMoreTokens)
            {
                token = tok.NextToken();
                if (token.Length <= 18)
                {
                    WriteField(bOut, Int64.Parse(token));
                }
                else
                {
                    WriteField(bOut, new BigInteger(token));
                }
            }
        }
        internal override void Encode(DerOutputStream derOut)
        {
            var tok = new OidTokenizer(_identifier);

            using (var bOut = new MemoryStream())
            {
                using (var dOut = new DerOutputStream(bOut))
                {
                    var token = tok.NextToken();
                    var first = int.Parse(token);

                    token = tok.NextToken();
                    var second = int.Parse(token);

                    WriteField(bOut, first * 40 + second);

                    while (tok.HasMoreTokens)
                    {
                        token = tok.NextToken();
                        if (token.Length < 18)
                        {
                            WriteField(bOut, Int64.Parse(token));
                        }
                        else
                        {
                            WriteField(bOut, new BigInteger(token));
                        }
                    }
                }
                derOut.WriteEncoded(Asn1Tags.ObjectIdentifier, bOut.ToArray());
            }
        }
예제 #3
0
        private void DoOutput(MemoryStream bOut)
        {
            OidTokenizer oidTokenizer = new OidTokenizer(this.identifier);
            string       text         = oidTokenizer.NextToken();
            int          num          = int.Parse(text) * 40;

            text = oidTokenizer.NextToken();
            if (text.Length <= 18)
            {
                this.WriteField(bOut, (long)num + long.Parse(text));
            }
            else
            {
                this.WriteField(bOut, new BigInteger(text).Add(BigInteger.ValueOf((long)num)));
            }
            while (oidTokenizer.HasMoreTokens)
            {
                text = oidTokenizer.NextToken();
                if (text.Length <= 18)
                {
                    this.WriteField(bOut, long.Parse(text));
                }
                else
                {
                    this.WriteField(bOut, new BigInteger(text));
                }
            }
        }
예제 #4
0
        private void DoOutput(MemoryStream bOut)
        {
            OidTokenizer oidTokenizer = new OidTokenizer(identifier);
            string       text         = oidTokenizer.NextToken();
            int          num          = int.Parse(text) * 40;

            text = oidTokenizer.NextToken();
            if (text.get_Length() <= 18)
            {
                WriteField((Stream)(object)bOut, num + long.Parse(text));
            }
            else
            {
                WriteField((Stream)(object)bOut, new BigInteger(text).Add(BigInteger.ValueOf(num)));
            }
            while (oidTokenizer.HasMoreTokens)
            {
                text = oidTokenizer.NextToken();
                if (text.get_Length() <= 18)
                {
                    WriteField((Stream)(object)bOut, long.Parse(text));
                }
                else
                {
                    WriteField((Stream)(object)bOut, new BigInteger(text));
                }
            }
        }
예제 #5
0
        private void DoOutput(MemoryStream bOut)
        {
            OidTokenizer oidTokenizer = new OidTokenizer(identifier);
            string       s            = oidTokenizer.NextToken();
            int          num          = int.Parse(s) * 40;

            s = oidTokenizer.NextToken();
            if (s.Length <= 18)
            {
                WriteField(bOut, num + long.Parse(s));
            }
            else
            {
                WriteField(bOut, new BigInteger(s).Add(BigInteger.ValueOf(num)));
            }
            while (oidTokenizer.HasMoreTokens)
            {
                s = oidTokenizer.NextToken();
                if (s.Length <= 18)
                {
                    WriteField(bOut, long.Parse(s));
                }
                else
                {
                    WriteField(bOut, new BigInteger(s));
                }
            }
        }
예제 #6
0
        private void DoOutput(MemoryStream bOut)
        {
            OidTokenizer tokenizer = new OidTokenizer(this.identifier);
            int          num       = int.Parse(tokenizer.NextToken()) * 40;
            string       s         = tokenizer.NextToken();

            if (s.Length <= 0x12)
            {
                this.WriteField(bOut, (long)(num + long.Parse(s)));
            }
            else
            {
                this.WriteField(bOut, new BigInteger(s).Add(BigInteger.ValueOf((long)num)));
            }
            while (tokenizer.HasMoreTokens)
            {
                s = tokenizer.NextToken();
                if (s.Length <= 0x12)
                {
                    this.WriteField(bOut, long.Parse(s));
                }
                else
                {
                    this.WriteField(bOut, new BigInteger(s));
                }
            }
        }
        internal override void Encode(
            DerOutputStream derOut)
        {
            OidTokenizer    tok  = new OidTokenizer(identifier);
            MemoryStream    bOut = new MemoryStream();
            DerOutputStream dOut = new DerOutputStream(bOut);

            string token = tok.NextToken();
            int    first = System.Int32.Parse(token);

            token = tok.NextToken();
            int second = System.Int32.Parse(token);

            WriteField(bOut, first * 40 + second);

            while (tok.HasMoreTokens)
            {
                token = tok.NextToken();
                if (token.Length < 18)
                {
                    WriteField(bOut, Int64.Parse(token));
                }
                else
                {
                    WriteField(bOut, new BigInteger(token));
                }
            }

            dOut.Close();

            byte[] bytes = bOut.ToArray();

            derOut.WriteEncoded(Asn1Tags.ObjectIdentifier, bytes);
        }
예제 #8
0
        internal override void Encode(
            DerOutputStream derOut)
        {
            OidTokenizer tok = new OidTokenizer(identifier);
            MemoryStream bOut = new MemoryStream();
            DerOutputStream dOut = new DerOutputStream(bOut);

			string token = tok.NextToken();
            int first = int.Parse(token);

			token = tok.NextToken();
            int second = int.Parse(token);

            WriteField(bOut, first * 40 + second);

            while (tok.HasMoreTokens)
            {
				token = tok.NextToken();
				if (token.Length < 18)
				{
					WriteField(bOut, Int64.Parse(token));
				}
				else
				{
					WriteField(bOut, new BigInteger(token));
				}
			}

			dOut.Close();

			derOut.WriteEncoded(Asn1Tags.ObjectIdentifier, bOut.ToArray());
        }
예제 #9
0
        private void DoOutput(MemoryStream bOut)
        {
            OidTokenizer tok = new OidTokenizer(identifier);

            string token = tok.NextToken();
            int first = int.Parse(token) * 40;

            token = tok.NextToken();
            if (token.Length <= 18)
            {
                WriteField(bOut, first + Int64.Parse(token));
            }
            else
            {
                WriteField(bOut, new BigInteger(token).Add(BigInteger.ValueOf(first)));
            }

            while (tok.HasMoreTokens)
            {
                token = tok.NextToken();
                if (token.Length <= 18)
                {
                    WriteField(bOut, Int64.Parse(token));
                }
                else
                {
                    WriteField(bOut, new BigInteger(token));
                }
            }
        }