public SenderIdentity(BaseKeyId id, TagPubKey publicKey, string?name)
 {
     Id        = id.Required();
     PublicKey = publicKey.Required();
     Name      = name;
     _reader   = new Lazy <TagReader>(() => new TagReader(Id.TextualRepresentation, PublicKey));
 }
 public InterlockKey(KeyPurpose[] purposes, string name, TagPubKey pubKey, BaseKeyId keyId, IEnumerable <AppPermissions> permissions, KeyStrength?strength = null, string description = null)
     : this(new Parts(purposes,
                      name,
                      description,
                      pubKey.Required(),
                      strength ?? pubKey.Strength,
                      keyId,
                      permissions))
 {
 }
Beispiel #3
0
 public bool IsSignedBy(BaseKeyId validSigner, TagPubKey validPubKey)
 => SignedContent is not null &&
 public void OneTimeSetup()
 {
     BaseKeyId.RegisterKeyIdTypes();
     new TestSignable().RegisterAsField(this);
 }
Beispiel #5
0
 protected override void DecodeRemainingStateFrom(Stream s)
 {
     Signature = s.Decode <TagSignature>();
     SignerId  = s.DecodeBaseKeyId();
     PublicKey = s.Decode <TagPubKey>();
 }
Beispiel #6
0
 public IdentifiedSignature(TagSignature signature, BaseKeyId id, TagPubKey publicKey) : this()
 {
     Signature = signature.Required();
     SignerId  = id.Required();
     PublicKey = publicKey.Required();
 }
 public InterlockUpdatableSigningKeyData(KeyPurpose[] purposes, string name, byte[] encrypted, TagPubKey pubKey, KeyStrength strength, DateTimeOffset creationTime, string description = null, BaseKeyId keyId = null)
     : this(new UpdatableParts(purposes, name, encrypted, pubKey, description, strength, keyId)) => LastSignatureTimeStamp = creationTime;
 public UpdatableParts(KeyPurpose[] purposes, string name, byte[] encrypted, TagPubKey pubKey, string description, KeyStrength strength, BaseKeyId keyId)
     : base(purposes, name, description, pubKey, strength, keyId, null)
 {
     Version   = InterlockUpdatableSigningKeyVersion;
     Encrypted = encrypted;
     LastSignatureTimeStamp   = DateTimeOffsetExtensions.TimeZero;
     SignaturesWithCurrentKey = 0;
 }
 public InterlockSigningKeyData(KeyPurpose[] purposes, IEnumerable <AppPermissions> permissions, string name, byte[] encrypted, TagPubKey pubKey, KeyStrength strength, string description = null, BaseKeyId keyId = null, EncryptedContentType encryptedContentType = EncryptedContentType.EncryptedKey)
     : this(new InterlockSigningKeyParts(purposes, permissions, name, encrypted, pubKey, description, strength, encryptedContentType, keyId))
 {
 }
 public InterlockSigningKeyParts(KeyPurpose[] purposes, IEnumerable <AppPermissions> permissions, string name, byte[] encrypted, TagPubKey pubKey, string description, KeyStrength strength, EncryptedContentType encryptedContentType, BaseKeyId keyId)
     : base(purposes, name, description, pubKey, strength, keyId, permissions)
 {
     Version              = InterlockSigningKeyVersion;
     Encrypted            = encrypted;
     EncryptedContentType = encryptedContentType;
 }
 public Parts(KeyPurpose[] purposes, string name, string description, TagPubKey pubKey, KeyStrength strength, BaseKeyId keyId, IEnumerable <AppPermissions> permissions)
 {
     if (string.IsNullOrWhiteSpace(name))
     {
         throw new ArgumentNullException(nameof(name));
     }
     Version     = InterlockKeyVersion;
     Name        = name;
     Purposes    = purposes.Required();
     PublicKey   = pubKey.Required();
     Description = description;
     Strength    = strength;
     if (Actionable && permissions.None())
     {
         Purposes = Purposes.Where(pu => pu != KeyPurpose.Action).ToArray(); // Remove Action Purpose
     }
     Permissions = permissions;
     Identity    = new KeyId(TagHash.HashSha256Of(_hashable));
     Id          = keyId ?? Identity;
 }
 InterlockSigningKeyData IKeyPhasedCreationProvider.CreateUsing(IKeyParameters emergencyKeyParameters, KeyStrength strength, BaseKeyId identity, string name, string description, string password, IEnumerable <AppPermissions> permissions, params KeyPurpose[] purposes)
 => FindPhasedProvider(emergencyKeyParameters.PublicKey.Algorithm).CreateUsing(emergencyKeyParameters, strength, identity, name, description, password, permissions, purposes);