当前位置: 首页>>代码示例>>Java>>正文


Java X509Certificate类代码示例

本文整理汇总了Java中org.osiam.resources.scim.X509Certificate的典型用法代码示例。如果您正苦于以下问题:Java X509Certificate类的具体用法?Java X509Certificate怎么用?Java X509Certificate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


X509Certificate类属于org.osiam.resources.scim包,在下文中一共展示了X509Certificate类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: update

import org.osiam.resources.scim.X509Certificate; //导入依赖的package包/类
/**
 * updates (adds new, delete, updates) the {@link X509CertificateEntity}'s of the given {@link UserEntity} based on
 * the given List of X509Certificate's
 *
 * @param x509Certificates list of X509Certificate's to be deleted, updated or added
 * @param userEntity       user who needs to be updated
 * @param attributes       all {@link X509CertificateEntity}'s will be deleted if this Set contains 'x509Certificates'
 */
void update(List<X509Certificate> x509Certificates, UserEntity userEntity, Set<String> attributes) {

    if (attributes.contains("x509Certificates")) {
        userEntity.removeAllX509Certificates();
    }

    if (x509Certificates != null) {
        for (X509Certificate scimX509Certificate : x509Certificates) {
            X509CertificateEntity x509CertificateEntity = x509CertificateConverter.fromScim(scimX509Certificate);
            userEntity.removeX509Certificate(x509CertificateEntity); // we always have to remove the x509Certificate
            // the primary attribute has changed
            if (Strings.isNullOrEmpty(scimX509Certificate.getOperation())
                    || !scimX509Certificate.getOperation().equalsIgnoreCase("delete")) {

                ensureOnlyOnePrimaryX509CertificateExists(x509CertificateEntity, userEntity.getX509Certificates());
                userEntity.addX509Certificate(x509CertificateEntity);
            }
        }
    }
}
 
开发者ID:osiam,项目名称:osiam,代码行数:29,代码来源:X509CertificateUpdater.java

示例2: updateCertificate

import org.osiam.resources.scim.X509Certificate; //导入依赖的package包/类
@Command(description = "Update a certificate from the user.", startsSubshell = true)
public void updateCertificate(
		@Param(value = "searchKey", description = "Which key should be used to identify the certificate.")
		String key,
		@Param(value = "expr", description = "If the value matches this regular expression, the certificate will updated.")
		String valueExp) throws IOException{

	Set<X509Certificate> certificates = builderCommand.showAllX509Certificates();
	for(X509Certificate current : certificates){
		if(match(current, key, valueExp)){
			final X509Certificate certificate = builderCommand.builderShellFactory.enterX509CertificateShell(current);
			if(certificate != null){
				builderCommand.builder.updateX509Certificate(current, certificate);
			}
		}
	}
}
 
开发者ID:osiam,项目名称:shell,代码行数:18,代码来源:UpdateUserUpdateCommands.java

示例3: enterX509CertificateShell

import org.osiam.resources.scim.X509Certificate; //导入依赖的package包/类
/**
 * Enter a new subshell for creating a {@link X509Certificate}.
 *
 * @param current The current persisted {@link X509Certificate}.
 * @return The {@link X509Certificate}. Or null if the user interrupt the process.
 * @throws IOException
 */
public X509Certificate enterX509CertificateShell(X509Certificate current) throws IOException {
	final X509CertificateBuilder x509CertificateBuilder = new X509CertificateBuilder(current);

	final Shell subShell = ShellBuilder.subshell((current == null ? "create" : "replace") + "-certificate", shell)
		.behavior()
			.disableExitCommand()
			.addHandler(x509CertificateBuilder)
		.build();

	output.out()
		.normal("In this subshell you can create a certificate. Leave this sub shell via \"commit\" to persist the changes.")
	.println();

	subShell.commandLoop();

	return x509CertificateBuilder.build();
}
 
开发者ID:osiam,项目名称:shell,代码行数:25,代码来源:BuilderShellFactory.java

示例4: getX509Certificates

import org.osiam.resources.scim.X509Certificate; //导入依赖的package包/类
private static ArrayList<X509Certificate> getX509Certificates() {

        X509Certificate x509Certificate = new X509Certificate.Builder()
                .setPrimary(true)
                .setValue("MIIBrTCCARagAwIBAgIFHL6O8kAwDQYJKoZIhvcNAQEFBQAwGDEWMBQGA1UEAxMNRXhhbXBsZUlz"
                        + "c3VlcjAiGA8yMDAwMDEwMTAwMDAwMFoYDzIwNTAwMTAxMDAwMDAwWjAZMRcwFQYDVQQDEw5FeGFt"
                        + "cGxlU3ViamVjdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApbwnNhV4Mgn1VrQctOaSkoTg"
                        + "S6VqDulOAgGvDxwGMaAILWn0lNU50P7mkyFemGLCAWT+JGxgk7XLmaJtTGdA+9z7GnxRtxRpsnEL"
                        + "yAleVvAVNvZxecMIYyuUM2ZRBZWAnyDig4HomVAXz3rA0B32L37qmf+e3Z/Yie2ft4l41FcCAwEA"
                        + "ATANBgkqhkiG9w0BAQUFAAOBgQBE9aUWNuXhRGK225tGPzMKOa3WkltBiZOv8RNCavvKkp6/WIle"
                        + "KWtoNwSwUGjq+VhVcGqBfPEqDN8eC5DeCIxmQqkvxVQLe8hAZ4o5upSvfxvttj1NbSJMBf6NtDrB"
                        + "aVjjgqxSubteb6th+cqTsPdUsn5WfDbDjeuSa5d0fOEBzw==")
                .build();

        ArrayList<X509Certificate> x509Certificates = new ArrayList<X509Certificate>();
        x509Certificates.add(x509Certificate);

        return x509Certificates;
    }
 
开发者ID:osiam,项目名称:test-suites,代码行数:20,代码来源:TestDataCreation.java

示例5: updateX509Certificate

import org.osiam.resources.scim.X509Certificate; //导入依赖的package包/类
private void updateX509Certificate(UpdateUser.Builder updateBuilder, List<X509Certificate> x509Certificates,
        String value) {
    X509Certificate newX509Certificate = new X509Certificate.Builder().setValue(value)
            .setType(new X509Certificate.Type(LdapAuthentication.LDAP_PROVIDER)).build();
    for (X509Certificate x509Certificate : x509Certificates) {
        if (x509Certificate.getType() != null
                && x509Certificate.getType().toString().equals(LdapAuthentication.LDAP_PROVIDER)) {
            updateBuilder.deleteX509Certificate(x509Certificate);
        }
    }
    updateBuilder.addX509Certificate(newX509Certificate);
}
 
开发者ID:osiam,项目名称:auth-server,代码行数:13,代码来源:OsiamLdapUserContextMapper.java

示例6: fromScim

import org.osiam.resources.scim.X509Certificate; //导入依赖的package包/类
@Override
public X509CertificateEntity fromScim(X509Certificate scim) {
    X509CertificateEntity x509CertificateEntity = new X509CertificateEntity();
    x509CertificateEntity.setValue(scim.getValue());
    x509CertificateEntity.setType(scim.getType());
    x509CertificateEntity.setPrimary(scim.isPrimary());
    x509CertificateEntity.setDisplay(scim.getDisplay());
    return x509CertificateEntity;
}
 
开发者ID:osiam,项目名称:osiam,代码行数:10,代码来源:X509CertificateConverter.java

示例7: toScim

import org.osiam.resources.scim.X509Certificate; //导入依赖的package包/类
@Override
public X509Certificate toScim(X509CertificateEntity entity) {
    return new X509Certificate.Builder()
            .setValue(entity.getValue())
            .setPrimary(entity.isPrimary())
            .setType(entity.getType())
            .setDisplay(entity.getDisplay())
            .build();
}
 
开发者ID:osiam,项目名称:osiam,代码行数:10,代码来源:X509CertificateConverter.java

示例8: convertToDatabaseColumn

import org.osiam.resources.scim.X509Certificate; //导入依赖的package包/类
@Override
public String convertToDatabaseColumn(X509Certificate.Type attribute) {
    if (attribute == null || Strings.isNullOrEmpty(attribute.getValue())) {
        return null;
    }

    return attribute.getValue();
}
 
开发者ID:osiam,项目名称:osiam,代码行数:9,代码来源:X509CertificateTypeConverter.java

示例9: convertToEntityAttribute

import org.osiam.resources.scim.X509Certificate; //导入依赖的package包/类
@Override
public X509Certificate.Type convertToEntityAttribute(String dbData) {
    if (Strings.isNullOrEmpty(dbData)) {
        return null;
    }

    return new X509Certificate.Type(dbData);
}
 
开发者ID:osiam,项目名称:osiam,代码行数:9,代码来源:X509CertificateTypeConverter.java

示例10: fromScim

import org.osiam.resources.scim.X509Certificate; //导入依赖的package包/类
@Override
public X509CertificateEntity fromScim(X509Certificate scim) {
    X509CertificateEntity x509CertificateEntity = new X509CertificateEntity();
    x509CertificateEntity.setValue(scim.getValue());
    x509CertificateEntity.setType(scim.getType());
    x509CertificateEntity.setPrimary(scim.isPrimary());

    return x509CertificateEntity;
}
 
开发者ID:osiam,项目名称:resource-server,代码行数:10,代码来源:X509CertificateConverter.java

示例11: toScim

import org.osiam.resources.scim.X509Certificate; //导入依赖的package包/类
@Override
public X509Certificate toScim(X509CertificateEntity entity) {
    return new X509Certificate.Builder()
            .setValue(entity.getValue())
            .setPrimary(entity.isPrimary())
            .setType(entity.getType())
            .build();
}
 
开发者ID:osiam,项目名称:resource-server,代码行数:9,代码来源:X509CertificateConverter.java

示例12: X509CertificateCommand

import org.osiam.resources.scim.X509Certificate; //导入依赖的package包/类
public X509CertificateCommand(X509Certificate x509Certificate) {
    setDisplay(x509Certificate.getDisplay());
    setPrimary(x509Certificate.isPrimary());
    setValue(x509Certificate.getValue());

    if (x509Certificate.getType() != null) {
        setType(x509Certificate.getType().getValue());
    }
}
 
开发者ID:osiam,项目名称:addon-administration,代码行数:10,代码来源:X509CertificateCommand.java

示例13: getAsCertificate

import org.osiam.resources.scim.X509Certificate; //导入依赖的package包/类
public X509Certificate getAsCertificate() {
    return new X509Certificate.Builder()
            .setDisplay(getDisplay())
            .setPrimary(getPrimary())
            .setValue(getValue())
            .setType(new Type(getType()))
            .build();
}
 
开发者ID:osiam,项目名称:addon-administration,代码行数:9,代码来源:X509CertificateCommand.java

示例14: deleteCertificate

import org.osiam.resources.scim.X509Certificate; //导入依赖的package包/类
@Command(description = "Delete a certificate from the user.")
public void deleteCertificate(
		@Param(value = "searchKey", description = "Which key should be used to identify the certificate.")
		String key,
		@Param(value = "expr", description = "If the value matches this regular expression, the certificate will deleted.")
		String valueExp){
	
	Set<X509Certificate> certificates = builderCommand.showAllX509Certificates();
	for(X509Certificate current : certificates){
		if(match(current, key, valueExp)){
			builderCommand.builder.deleteX509Certificate(current);
		}
	}
}
 
开发者ID:osiam,项目名称:shell,代码行数:15,代码来源:UpdateUserDeleteCommands.java

示例15: a

import org.osiam.resources.scim.X509Certificate; //导入依赖的package包/类
@Command(name = "add-certificate", description = "Add a (X509)certificate for this user.", startsSubshell = true)
public void addX509Certificate() throws IOException {
	final X509Certificate x509Certificate = builderCommand.builderShellFactory.enterX509CertificateShell();
	if(x509Certificate != null){
		builderCommand.builder.addX509Certificate(x509Certificate);
	}
}
 
开发者ID:osiam,项目名称:shell,代码行数:8,代码来源:UpdateUserAddCommands.java


注:本文中的org.osiam.resources.scim.X509Certificate类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。