Skip to content

Commit

Permalink
update cbom meta data (#62) (#63)
Browse files Browse the repository at this point in the history
Signed-off-by: Nicklas Körtge <[email protected]>
  • Loading branch information
n1ckl0sk0rtge authored Jul 18, 2024
1 parent 70d5033 commit 4d3e9cc
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 13 deletions.
4 changes: 2 additions & 2 deletions output/src/main/java/com/ibm/output/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ private Constants() {
// nothing
}

public static final String SCANNER_NAME = "SonarQube Crypto Scanner Plugin";
public static final String SCANNER_VENDOR = "IBM Research";
public static final String SCANNER_NAME = "Sonar Cryptography Plugin";
public static final String SCANNER_VENDOR = "IBM";
}
60 changes: 49 additions & 11 deletions output/src/main/java/com/ibm/output/cyclondx/CBOMOutputFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,34 @@
*/
package com.ibm.output.cyclondx;

import com.ibm.mapper.model.*;
import com.ibm.mapper.model.Algorithm;
import com.ibm.mapper.model.BlockSize;
import com.ibm.mapper.model.DigestSize;
import com.ibm.mapper.model.EllipticCurve;
import com.ibm.mapper.model.INode;
import com.ibm.mapper.model.IProperty;
import com.ibm.mapper.model.Key;
import com.ibm.mapper.model.KeyLength;
import com.ibm.mapper.model.Mode;
import com.ibm.mapper.model.Oid;
import com.ibm.mapper.model.OptimalAsymmetricEncryptionPadding;
import com.ibm.mapper.model.Padding;
import com.ibm.mapper.model.ParameterSetIdentifier;
import com.ibm.mapper.model.PasswordLength;
import com.ibm.mapper.model.Protocol;
import com.ibm.mapper.model.SaltLength;
import com.ibm.mapper.model.collections.CipherSuiteCollection;
import com.ibm.mapper.model.functionality.*;
import com.ibm.mapper.model.functionality.Decapsulate;
import com.ibm.mapper.model.functionality.Decrypt;
import com.ibm.mapper.model.functionality.Digest;
import com.ibm.mapper.model.functionality.Encapsulate;
import com.ibm.mapper.model.functionality.Encrypt;
import com.ibm.mapper.model.functionality.Generate;
import com.ibm.mapper.model.functionality.KeyDerivation;
import com.ibm.mapper.model.functionality.KeyGeneration;
import com.ibm.mapper.model.functionality.Sign;
import com.ibm.mapper.model.functionality.Tag;
import com.ibm.mapper.model.functionality.Verify;
import com.ibm.mapper.utils.DetectionLocation;
import com.ibm.output.Constants;
import com.ibm.output.IOutputFile;
Expand All @@ -30,22 +55,35 @@
import com.ibm.output.cyclondx.builder.ProtocolComponentBuilder;
import com.ibm.output.cyclondx.builder.RelatedCryptoMaterialComponentBuilder;
import com.ibm.output.util.Utils;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Stream;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.apache.commons.io.FileUtils;
import org.cyclonedx.Version;
import org.cyclonedx.generators.BomGeneratorFactory;
import org.cyclonedx.generators.json.BomJsonGenerator;
import org.cyclonedx.model.*;
import org.cyclonedx.model.Bom;
import org.cyclonedx.model.Component;
import org.cyclonedx.model.Dependency;
import org.cyclonedx.model.Metadata;
import org.cyclonedx.model.OrganizationalEntity;
import org.cyclonedx.model.Service;
import org.cyclonedx.model.component.evidence.Occurrence;
import org.cyclonedx.model.metadata.ToolInformation;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Properties;
import java.util.UUID;
import java.util.function.Function;
import java.util.stream.Stream;

public class CBOMOutputFile implements IOutputFile {

private static final Version schema = Version.VERSION_16;
Expand Down

0 comments on commit 4d3e9cc

Please sign in to comment.