| 1 | // Copyright The Notary Project Authors. |
| 2 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | // you may not use this file except in compliance with the License. |
| 4 | // You may obtain a copy of the License at |
| 5 | // |
| 6 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | // |
| 8 | // Unless required by applicable law or agreed to in writing, software |
| 9 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | // See the License for the specific language governing permissions and |
| 12 | // limitations under the License. |
| 13 | |
| 14 | // Package plugin provides the tooling to use the notation plugin. |
| 15 | // |
| 16 | // includes a CLIManager and a CLIPlugin implementation. |
| 17 | package pluginscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/ |
| 18 | |
| 19 | import ( |
| 20 | "contextscip-go gomod github.com/golang/go/src go1.20 context/" |
| 21 | ) |
| 22 | |
| 23 | // GenericPlugin is the base requirement to be a plugin. |
| 24 | type GenericPluginscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/GenericPlugin# interface { |
| 25 | // GetMetadata returns the metadata information of the plugin. |
| 26 | GetMetadatascip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/GenericPlugin#GetMetadata.(ctx contextscip-go gomod github.com/golang/go/src go1.20 context/.Contextscip-go gomod github.com/golang/go/src go1.20 context/Context#, req *GetMetadataRequestscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/GetMetadataRequest#) (*GetMetadataResponsescip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/GetMetadataResponse#, error) |
| 27 | } |
| 28 | |
| 29 | // SignPlugin defines the required methods to be a SignPlugin. |
| 30 | type SignPluginscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/SignPlugin# interface { |
| 31 | GenericPluginscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/GenericPlugin# |
| 32 | |
| 33 | // DescribeKey returns the KeySpec of a key. |
| 34 | DescribeKeyscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/SignPlugin#DescribeKey.(ctx contextscip-go gomod github.com/golang/go/src go1.20 context/.Contextscip-go gomod github.com/golang/go/src go1.20 context/Context#, req *DescribeKeyRequestscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/DescribeKeyRequest#) (*DescribeKeyResponsescip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/DescribeKeyResponse#, error) |
| 35 | |
| 36 | // GenerateSignature generates the raw signature based on the request. |
| 37 | GenerateSignaturescip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/SignPlugin#GenerateSignature.(ctx contextscip-go gomod github.com/golang/go/src go1.20 context/.Contextscip-go gomod github.com/golang/go/src go1.20 context/Context#, req *GenerateSignatureRequestscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/GenerateSignatureRequest#) (*GenerateSignatureResponsescip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/GenerateSignatureResponse#, error) |
| 38 | |
| 39 | // GenerateEnvelope generates the Envelope with signature based on the |
| 40 | // request. |
| 41 | GenerateEnvelopescip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/SignPlugin#GenerateEnvelope.(ctx contextscip-go gomod github.com/golang/go/src go1.20 context/.Contextscip-go gomod github.com/golang/go/src go1.20 context/Context#, req *GenerateEnvelopeRequestscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/GenerateEnvelopeRequest#) (*GenerateEnvelopeResponsescip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/GenerateEnvelopeResponse#, error) |
| 42 | } |
| 43 | |
| 44 | // VerifyPlugin defines the required method to be a VerifyPlugin. |
| 45 | type VerifyPluginscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/VerifyPlugin# interface { |
| 46 | GenericPluginscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/GenericPlugin# |
| 47 | |
| 48 | // VerifySignature validates the signature based on the request. |
| 49 | VerifySignaturescip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/VerifyPlugin#VerifySignature.(ctx contextscip-go gomod github.com/golang/go/src go1.20 context/.Contextscip-go gomod github.com/golang/go/src go1.20 context/Context#, req *VerifySignatureRequestscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/VerifySignatureRequest#) (*VerifySignatureResponsescip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/VerifySignatureResponse#, error) |
| 50 | } |
| 51 | |
| 52 | // Plugin defines required methods to be a Plugin. |
| 53 | type Pluginscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/Plugin# interface { |
| 54 | SignPluginscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/SignPlugin# |
| 55 | VerifyPluginscip-go gomod github.com/notaryproject/notation-plugin-framework-go . `github.com/notaryproject/notation-plugin-framework-go/plugin`/VerifyPlugin# |
| 56 | } |