Esempio n. 1
0
        public Anchor(AttrpubapiV1.Anchor protobufAnchor)
        {
            AnchorVerifierSourceData anchorSourceData = AnchorCertificateParser.GetTypesFromAnchor(protobufAnchor);

            _anchorType = anchorSourceData.GetAnchorType();
            _value      = anchorSourceData.GetEntries().ToList();

            _artifactSignature = protobufAnchor.ArtifactSignature.ToByteArray();
            _signature         = protobufAnchor.Signature.ToByteArray();
            _subType           = protobufAnchor.SubType;
            _originServerCerts = ConvertRawCertToX509List(protobufAnchor.OriginServerCerts);

            var protobufSignedTimestamp = CompubapiV1.SignedTimestamp.Parser.ParseFrom(protobufAnchor.SignedTimeStamp.ToByteArray());

            _signedTimeStamp = new SignedTimestamp(protobufSignedTimestamp);
        }
Esempio n. 2
0
        public Anchor(ProtoBuf.Attribute.Anchor protobufAnchor)
        {
            Validation.NotNull(protobufAnchor, nameof(protobufAnchor));

            AnchorVerifierSourceData anchorSourceData = AnchorCertificateParser.GetTypesFromAnchor(protobufAnchor);

            _anchorType = anchorSourceData.GetAnchorType();
            _value      = anchorSourceData.GetEntries().FirstOrDefault();

            _signature         = protobufAnchor.Signature.ToByteArray();
            _subType           = protobufAnchor.SubType;
            _originServerCerts = ConvertRawCertToX509List(protobufAnchor.OriginServerCerts);

            var protobufSignedTimestamp = ProtoBuf.Common.SignedTimestamp.Parser.ParseFrom(protobufAnchor.SignedTimeStamp.ToByteArray());

            _signedTimeStamp = new SignedTimestamp(protobufSignedTimestamp);
        }