001/* 002 * Copyright 2009-2018 Ping Identity Corporation 003 * All Rights Reserved. 004 */ 005/* 006 * Copyright (C) 2015-2018 Ping Identity Corporation 007 * 008 * This program is free software; you can redistribute it and/or modify 009 * it under the terms of the GNU General Public License (GPLv2 only) 010 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only) 011 * as published by the Free Software Foundation. 012 * 013 * This program is distributed in the hope that it will be useful, 014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 016 * GNU General Public License for more details. 017 * 018 * You should have received a copy of the GNU General Public License 019 * along with this program; if not, see <http://www.gnu.org/licenses>. 020 */ 021package com.unboundid.ldap.sdk.unboundidds.logs; 022 023 024 025import com.unboundid.util.NotMutable; 026import com.unboundid.util.ThreadSafety; 027import com.unboundid.util.ThreadSafetyLevel; 028 029 030 031/** 032 * This class provides a data structure that holds information about a log 033 * message that may appear in the Directory Server access log about a client 034 * certificate that has been presented to the server. 035 * <BR> 036 * <BLOCKQUOTE> 037 * <B>NOTE:</B> This class, and other classes within the 038 * {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only 039 * supported for use against Ping Identity, UnboundID, and 040 * Nokia/Alcatel-Lucent 8661 server products. These classes provide support 041 * for proprietary functionality or for external specifications that are not 042 * considered stable or mature enough to be guaranteed to work in an 043 * interoperable way with other types of LDAP servers. 044 * </BLOCKQUOTE> 045 */ 046@NotMutable() 047@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE) 048public final class ClientCertificateAccessLogMessage 049 extends AccessLogMessage 050{ 051 /** 052 * The serial version UID for this serializable class. 053 */ 054 private static final long serialVersionUID = -2585979292882352926L; 055 056 057 058 // The subject DN for the issuer certificate. 059 private final String issuerSubject; 060 061 // The subject DN for the client certificate. 062 private final String peerSubject; 063 064 065 066 /** 067 * Creates a new client certificate access log message from the provided 068 * message string. 069 * 070 * @param s The string to be parsed as a client certificate access log 071 * message. 072 * 073 * @throws LogException If the provided string cannot be parsed as a valid 074 * log message. 075 */ 076 public ClientCertificateAccessLogMessage(final String s) 077 throws LogException 078 { 079 this(new LogMessage(s)); 080 } 081 082 083 084 /** 085 * Creates a new connect access log message from the provided log message. 086 * 087 * @param m The log message to be parsed as a connect access log message. 088 */ 089 public ClientCertificateAccessLogMessage(final LogMessage m) 090 { 091 super(m); 092 093 peerSubject = getNamedValue("peerSubject"); 094 issuerSubject = getNamedValue("issuerSubject"); 095 } 096 097 098 099 /** 100 * Retrieves the subject of the peer certificate. 101 * 102 * @return The subject of the peer certificate, or {@code null} if it is not 103 * included in the log message. 104 */ 105 public String getPeerSubject() 106 { 107 return peerSubject; 108 } 109 110 111 112 /** 113 * Retrieves the subject of the issuer certificate. 114 * 115 * @return The subject of the issuer certificate, or {@code null} if it is 116 * not included in the log message. 117 */ 118 public String getIssuerSubject() 119 { 120 return issuerSubject; 121 } 122 123 124 125 /** 126 * {@inheritDoc} 127 */ 128 @Override() 129 public AccessLogMessageType getMessageType() 130 { 131 return AccessLogMessageType.CLIENT_CERTIFICATE; 132 } 133}