QueryAsRecord for Token or SmartCard

martin_scholzmartin_scholz Member ✭✭
edited August 12 in Xamarin.Mac

Is it possible to search certificates stored on a token (YubiKey,...) or a Smart Card? Like described in the CryptoToken API you only have to add the TokenID to the query. Problem is that in the Xamarin iOS SDK for SecRecord you have a property TokenID but unfortunately not in the Xamarin.Mac SDK.

Tagged:

Answers

  • martin_scholzmartin_scholz Member ✭✭

    I temporary fixed this with creating my own class until it's officially in the SDK

    public class MySecRecord : SecRecord
        {
            public MySecRecord(SecKind secKind) : base(secKind)
            {
            }
    
            [Mac(10,12)]
            public String TokenID
            {
                [MethodImpl(MethodImplOptions.NoInlining)]
                get;
                [MethodImpl(MethodImplOptions.NoInlining)]
                set;
            }
        }
    

    Instead of public SecTokenID TokenID i make it a String.

Sign In or Register to comment.