/*
 * JBoss, Home of Professional Open Source.
 * Copyright 2015 Red Hat, Inc., and individual contributors
 * as indicated by the @author tags.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.wildfly.security.evidence;

import java.security.cert.X509Certificate;

public final class X509PeerCertificateEvidence implements Evidence {
    private final X509Certificate peerCertificate;

    public X509PeerCertificateEvidence(final X509Certificate peerCertificate) {
        this.peerCertificate = peerCertificate;
    }

    public X509Certificate getPeerCertificate() {
        return peerCertificate;
    }
}

@@ -785,16 +785,132 @@
 icate;%0A%0A
+import org.wildfly.common.Assert;%0A%0A/**%0A * A piece of evidence that is comprised of a verified peer certificate.%0A */%0A
 public f
@@ -959,16 +959,25 @@
 lements 
+Algorithm
 Evidence
@@ -979,16 +979,17 @@
 dence %7B%0A
+%0A
     priv
@@ -1040,219 +1040,788 @@
     
-public X509PeerCertificateEvidence(final X509Certificate peerCertificate) %7B%0A        this.peerCertificate = peerCertificate;%0A    %7D%0A%0A    public X509Certificate getPeerCertificate() %7B%0A        return peerCertificate
+/**%0A     * Construct a new instance.%0A     *%0A     * @param peerCertificate the peer certificate to use (must not be %7B@code null%7D)%0A     */%0A    public X509PeerCertificateEvidence(final X509Certificate peerCertificate) %7B%0A        Assert.checkNotNullParam(%22peerCertificate%22, peerCertificate);%0A        this.peerCertificate = peerCertificate;%0A    %7D%0A%0A    /**%0A     * Get the peer certificate.%0A     *%0A     * @return the peer certificate (not %7B@code null%7D)%0A     */%0A    public X509Certificate getPeerCertificate() %7B%0A        return peerCertificate;%0A    %7D%0A%0A    /**%0A     * Get the certificate public key algorithm.%0A     *%0A     * @return the certificate public key algorithm (not %7B@code null%7D)%0A     */%0A    public String getAlgorithm() %7B%0A        return peerCertificate.getPublicKey().getAlgorithm()
 ;%0A  

Update X509PeerCertificateEvidence to use AlgorithmEvidence API, proper JavaDoc, and null checking