| 62 | } |
| 63 | |
| 64 | func NewDigestedArtifact(client oci.Client, reference, digestAlg string) (artifact *DigestedArtifact, err error) { |
| 65 | normalized, artifactType, err := normalizeReference(reference, os.PathSeparator) |
| 66 | if err != nil { |
| 67 | return nil, err |
| 68 | } |
| 69 | if artifactType == ociArtifactType { |
| 70 | // TODO: should we allow custom digestAlg for OCI artifacts? |
| 71 | return digestContainerImageArtifact(normalized, client) |
| 72 | } |
| 73 | return digestLocalFileArtifact(normalized, digestAlg) |
| 74 | } |
| 75 | |
| 76 | // Digest returns the artifact's digest |
| 77 | func (a *DigestedArtifact) Digest() string { |