protected override async Task <SecretBundle> OnVersionChangeAsync(CustomVersion cv)
        {
            SecretVersion sv = (SecretVersion)cv;
            var           s  = await _session.CurrentVault.GetSecretAsync(sv.SecretItem.Identifier.Name, sv.SecretItem.Identifier.Version);

            RefreshSecretObject(s);
            AutoDetectSecretKind();
            return(s);
        }
        protected override async Task <CertificateBundle> OnVersionChangeAsync(CustomVersion cv)
        {
            var cb = await _session.CurrentVault.GetCertificateAsync(cv.Id.Name, (cv.Index == 0)?null : cv.Id.Version);   // Pass NULL as a version to fetch current CertificatePolicy

            var cert = await _session.CurrentVault.GetCertificateWithExportableKeysAsync(cv.Id.Name, cv.Id.Version);

            if ((_certificatePolicy == null) && (cb.Policy != null)) // cb.Policy will be NULL when version is not current
            {
                _certificatePolicy = cb.Policy;
            }
            RefreshCertificateObject(cb, _certificatePolicy, cert);
            return(cb);
        }
Example #3
0
 protected virtual Task <U> OnVersionChangeAsync(CustomVersion cv) => null;