Skip to content

Question about how to create a valid CryptoRefArray. #622

@lee-changhoon

Description

@lee-changhoon

Hi, I was trying to create "cryptoRefArray" like the protocol example of CBOM.
However, My code generates slightly different results from the protocol example and the results is not valid by schema validation.
So, I'd like to ask you how to change my code for valid CryptoRefArray.
Thank you.

  1. Protocol Example
    https://github.com/CycloneDX/bom-examples/blob/master/CBOM/Protocol/bom.json
"cryptoRefArray": [
"crypto/certificate/google.com@sha256:1e15e0fbd3ce95bde5945633ae96add551341b11e5bae7bba12e98ad84a5beb4"
]
  1. My code
// CryptoRef instance
List ref = new ArrayList<>();
ref.add("crypto/certificate/google.com@sha256:1e15e0fbd3ce95bde5945633ae96add551341b11e5bae7bba12e98ad84a5beb4");

CryptoRef cryptoRef = new CryptoRef();    
cryptoRef.setRef(ref);

// setCryptoRefArray ( parameter is cryptoRef instead of List )
protocolComponent.getCryptoProperties().getProtocolProperties().setCryptoRefArray(cryptoRef);
  1. The results of my code
  "cryptoRefArray" : {
	"ref" : [  "crypto/certificate/google.com@sha256:1e15e0fbd3ce95bde5945633ae96add551341b11e5bae7bba12e98ad84a5beb4"
	]
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions