Example #1
0
        public override CommandApdu AsApdu()
        {
            this.P1 = (byte)this.operation;
            this.P2 = this.operation == Operation.Close ? this.identifier : (byte)0x00;

            switch (this.operation)
            {
            case Operation.Open:
                return(CommandApdu.Case2S(ApduClass.GlobalPlatform, ApduInstruction.ManageChannel, this.P1, this.P2, 0x01));

            case Operation.Close:
                return(CommandApdu.Case1(ApduClass.GlobalPlatform, ApduInstruction.ManageChannel, this.P1, this.P2));

            default:
                throw new NotSupportedException("Operation not supported.");
            }
        }
Example #2
0
        public override CommandApdu AsApdu()
        {
            this.P1 = (byte)this.scope;

            switch (this.scope)
            {
            case Scope.IssuerSecurityDomain:
                return(CommandApdu.Case1(ApduClass.GlobalPlatform, ApduInstruction.SetStatus, this.P1, this.P2));

            case Scope.SecurityDomain:
            case Scope.Application:
                return(CommandApdu.Case3S(ApduClass.GlobalPlatform, ApduInstruction.SetStatus, this.P1, this.P2, this.application));

            default:
                throw new NotSupportedException("Scope not supported.");
            }
        }