예제 #1
0
        public Authenticator Decode(Asn1Element asn1Element)
        {
            Asn1Element childNode = asn1Element[0];

            for (var i = 0; i < childNode.Count; i++)
            {
                var node = childNode[i];

                switch (node.ContextSpecificTag)
                {
                case 0:
                    VersionNumber = node[0].AsLong();
                    break;

                case 1:
                    Realm = node[0].AsString();
                    break;

                case 2:
                    CName = new PrincipalName().Decode(node[0], Realm);
                    break;

                case 3:
                    Checksum = node[0].Value;
                    break;

                case 4:
                    CuSec = node[0].AsLong();
                    break;

                case 5:
                    CTime = node[0].AsDateTimeOffset();
                    break;

                case 6:
                    SubSessionKey = new EncryptionKey().Decode(node[0]);
                    break;

                case 7:
                    SequenceNumber = node[0].AsLong();
                    break;

                case 8:
                    var parent = node[0];

                    for (var p = 0; p < parent.Count; p++)
                    {
                        var azElements = AuthorizationDataElement.ParseElements(parent[p]);

                        Authorizations.AddRange(azElements);
                    }
                    break;
                }
            }

            return(this);
        }