All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.uid2.shared.secure.nitro.InMemoryAWSCertificateStore Maven / Gradle / Ivy

package com.uid2.shared.secure.nitro;

import com.uid2.shared.secure.ICertificateProvider;

import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;

public class InMemoryAWSCertificateStore implements ICertificateProvider {
    @Override
    public X509Certificate getRootCertificate() throws CertificateException {
        String rootPem = "-----BEGIN CERTIFICATE-----\n" +
                "MIICETCCAZagAwIBAgIRAPkxdWgbkK/hHUbMtOTn+FYwCgYIKoZIzj0EAwMwSTEL\n" +
                "MAkGA1UEBhMCVVMxDzANBgNVBAoMBkFtYXpvbjEMMAoGA1UECwwDQVdTMRswGQYD\n" +
                "VQQDDBJhd3Mubml0cm8tZW5jbGF2ZXMwHhcNMTkxMDI4MTMyODA1WhcNNDkxMDI4\n" +
                "MTQyODA1WjBJMQswCQYDVQQGEwJVUzEPMA0GA1UECgwGQW1hem9uMQwwCgYDVQQL\n" +
                "DANBV1MxGzAZBgNVBAMMEmF3cy5uaXRyby1lbmNsYXZlczB2MBAGByqGSM49AgEG\n" +
                "BSuBBAAiA2IABPwCVOumCMHzaHDimtqQvkY4MpJzbolL//Zy2YlES1BR5TSksfbb\n" +
                "48C8WBoyt7F2Bw7eEtaaP+ohG2bnUs990d0JX28TcPQXCEPZ3BABIeTPYwEoCWZE\n" +
                "h8l5YoQwTcU/9KNCMEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUkCW1DdkF\n" +
                "R+eWw5b6cp3PmanfS5YwDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMDA2kAMGYC\n" +
                "MQCjfy+Rocm9Xue4YnwWmNJVA44fA0P5W2OpYow9OYCVRaEevL8uO1XYru5xtMPW\n" +
                "rfMCMQCi85sWBbJwKKXdS6BptQFuZbT73o/gBh1qUxl/nNr12UO8Yfwr6wPLb+6N\n" +
                "IwLz3/Y=\n" +
                "-----END CERTIFICATE-----";
        InputStream is = new ByteArrayInputStream(rootPem.getBytes());
        return (X509Certificate) CertificateFactory.getInstance("X509").generateCertificate(is);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy