【问题标题】:Get KRB5/GSS status in Swift在 Swift 中获取 KRB5/GSS 状态
【发布时间】:2017-06-01 15:36:34
【问题描述】:

在 Swift 中,我如何获取用户 kerberos 票证的状态?我在https://developer.apple.com/reference/gss 看到了 GSS 库,但除了“它与这些函数名称一起存在”之外,绝对没有任何文档。

从名称看来,func GSSCredentialGetLifetime(_ cred: gss_cred_id_t) -> OM_uint32 似乎是我想要使用的,但我在哪里可以获取 gss_cred_id_t 类型的变量以传递给该函数?

【问题讨论】:

    标签: swift macos kerberos gss


    【解决方案1】:

    您可以遍历凭证(Kerberos 票证)以获取 gss_cred_id_t。例如:

    gss_iter_creds(&min_stat, 0, NULL, ^(gss_OID oid, gss_cred_id_t gcred) {
        if (gcred) {
            OM_uint32 lifetime = GSSCredentialGetLifetime(cred);
            NSLog(@"Lifetime: %d", lifetime);
        }
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-09-06
      • 1970-01-01
      • 2017-03-15
      • 1970-01-01
      • 2020-03-25
      • 2015-05-21
      • 1970-01-01
      相关资源
      最近更新 更多