class CsrFilenameCreator {

    public String createCsrFilename(KeyUsageInfo keyUsageInfo, CertificateRequestFormat csrFormat,
            ClientId memberId, SecurityServerId securityServerId) {
        StringBuilder builder = new StringBuilder();
        if (KeyUsageInfo.AUTHENTICATION == keyUsageInfo) {
            builder.append("auth");
        } else {
            builder.append("sign");
        }
        builder.append("_csr_");
        builder.append(createDateString());
        builder.append("_");
        builder.append(createIdentifier(keyUsageInfo, memberId, securityServerId));
        builder.append(".");
        builder.append(csrFormat.name().toLowerCase());
        return builder.toString();
    }

}