Ejemplo n.º 1
0
 internal SecretKeyInfo(
     string name,
     Func <SecretKeyInfo, string> descriptionBuilder,
     SecretKeyInfo subKey,
     IReadOnlyDictionary <string, SecretKeyInfo> keyInfos,
     string sourceProviderName)
     : this(name, descriptionBuilder, sourceProviderName)
 {
     SubKey = subKey ?? throw new ArgumentNullException(nameof(subKey));
     if (subKey.SuperKey != null)
     {
         throw new ArgumentException($"SubKey '{subKey.Name}' is already bound to SuperKey '{subKey.SuperKey.Name}'.");
     }
     if (!keyInfos.TryGetValue(subKey.Name, out var exists) || exists != subKey)
     {
         throw new ArgumentException($"SubKey '{subKey.Name}' is not found in store.");
     }
     subKey.SuperKey = this;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new <see cref="SecretKeyInfoDeclaredArgs"/>.
 /// </summary>
 /// <param name="declared">The declared secret key.</param>
 /// <param name="redeclaration">True when the secret has already been declared.</param>
 public SecretKeyInfoDeclaredArgs(SecretKeyInfo declared, bool redeclaration)
 {
     Declared      = declared;
     Redeclaration = redeclaration;
 }