public BSO getSMKey(IObjectWithSM obj, byte SMcondition) { if (obj == null) { return(null); } byte SMkey = SM.NoSM; if (obj.SM != null) { SMkey = obj.SM[SMcondition]; } if (SMkey == SM.NoSM) { return(null); } var df = obj is DF ? (obj as DF) : (obj as ICardObject).Parent; var key = df.GetChildBSO(Util.ToUShort(BSOClass.SM, SMkey), true); if (key == null) { throw new ISO7816Exception(Error.ObjectNotFound); } return(key); }
public SM(byte[] keys, IObjectWithSM owner,int numSM) { this.numSM = numSM; this.owner = owner; if (keys.Length > numSM) throw new ISO7816Exception(Error.DataFieldNotValid); foreach (byte b in keys) if (b == 0) throw new ISO7816Exception(Error.DataFieldNotValid); this.keys = keys; }
public SM(byte allKeyEnc, byte allKeySig, IObjectWithSM owner, int numSM) { this.numSM = numSM; this.owner = owner; keys = new byte[numSM]; for (int i = 0; i < numSM; i++) { if ((i%2)==0) keys[i] = allKeyEnc; else keys[i] = allKeySig; } }
public SM(byte allKeyEnc, byte allKeySig, IObjectWithSM owner, int numSM) { this.numSM = numSM; this.owner = owner; keys = new byte[numSM]; for (int i = 0; i < numSM; i++) { if ((i % 2) == 0) { keys[i] = allKeyEnc; } else { keys[i] = allKeySig; } } }
public SM(byte[] keys, IObjectWithSM owner, int numSM) { this.numSM = numSM; this.owner = owner; if (keys.Length > numSM) { throw new ISO7816Exception(Error.DataFieldNotValid); } foreach (byte b in keys) { if (b == 0) { throw new ISO7816Exception(Error.DataFieldNotValid); } } this.keys = keys; }
public virtual SM CreateSM(IObjectWithSM dest) { int numSM = 0; if (dest is BSO) { numSM = 16; } if (dest is DF) { numSM = 24; } if (dest is EF) { numSM = 24; } if (numSM == 0) { throw new Exception("Oggetto con SM non valido"); } return(new SM(SM.NoSM, SM.NoSM, dest, numSM)); }
//public override string ToString() //{ // return "SM for " + (obj as ICardObject).Description; //} public WrapperBSOSM(IObjectWithSM obj) { this.obj = obj; }
public BSO getSMKey(IObjectWithSM obj, byte SMcondition) { if (obj==null) return null; byte SMkey=SM.NoSM; if (obj.SM!=null) SMkey = obj.SM[SMcondition]; if (SMkey==SM.NoSM) return null; var df=obj is DF ? (obj as DF) : (obj as ICardObject).Parent; var key = df.GetChildBSO(Util.ToUShort(BSOClass.SM, SMkey), true); if (key == null) throw new ISO7816Exception(Error.ObjectNotFound); return key; }