Here you can find the source of convX509Name(X500Principal principal)
public static String convX509Name(X500Principal principal)
//package com.java2s; /*/*from www . j a v a 2 s . c o m*/ * ConvertUtils.java * PROJECT: JDigiDoc * DESCRIPTION: Digi Doc functions for creating * and reading signed documents. * AUTHOR: Veiko Sinivee, S|E|B IT Partner Estonia *================================================== * Copyright (C) AS Sertifitseerimiskeskus * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * GNU Lesser General Public Licence is available at * http://www.gnu.org/copyleft/lesser.html *================================================== */ import javax.security.auth.x500.X500Principal; public class Main { public static final String X509_NAME_RFC = "RFC2253"; public static String convX509Name(X500Principal principal) { String sName = principal.getName(X509_NAME_RFC); return sName; } }