CertFromBase64Converter.java

1
package com.yubico.fido.metadata;
2
3
import com.fasterxml.jackson.databind.JavaType;
4
import com.fasterxml.jackson.databind.type.TypeFactory;
5
import com.fasterxml.jackson.databind.util.Converter;
6
import com.yubico.internal.util.CertificateParser;
7
import com.yubico.webauthn.data.ByteArray;
8
import java.security.cert.CertificateException;
9
import java.security.cert.X509Certificate;
10
11
class CertFromBase64Converter implements Converter<String, X509Certificate> {
12
  @Override
13
  public X509Certificate convert(String value) {
14
    try {
15 1 1. convert : replaced return value with null for com/yubico/fido/metadata/CertFromBase64Converter::convert → KILLED
      return CertificateParser.parseDer(
16
          ByteArray.fromBase64(value.replaceAll("\\s+", "")).getBytes());
17
    } catch (CertificateException e) {
18
      throw new RuntimeException(e);
19
    }
20
  }
21
22
  @Override
23
  public JavaType getInputType(TypeFactory typeFactory) {
24 1 1. getInputType : replaced return value with null for com/yubico/fido/metadata/CertFromBase64Converter::getInputType → KILLED
    return typeFactory.constructType(String.class);
25
  }
26
27
  @Override
28
  public JavaType getOutputType(TypeFactory typeFactory) {
29 1 1. getOutputType : replaced return value with null for com/yubico/fido/metadata/CertFromBase64Converter::getOutputType → NO_COVERAGE
    return typeFactory.constructType(X509Certificate.class);
30
  }
31
}

Mutations

15

1.1
Location : convert
Killed by : com.yubico.fido.metadata.FidoMds3Spec
replaced return value with null for com/yubico/fido/metadata/CertFromBase64Converter::convert → KILLED

24

1.1
Location : getInputType
Killed by : com.yubico.fido.metadata.FidoMds3Spec
replaced return value with null for com/yubico/fido/metadata/CertFromBase64Converter::getInputType → KILLED

29

1.1
Location : getOutputType
Killed by : none
replaced return value with null for com/yubico/fido/metadata/CertFromBase64Converter::getOutputType → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.15.0