• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java X509Certificate类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: certificates

import org.osiam.resources.scim.X509Certificate; //导入依赖的package包/类
@Command(name = "show-all-certificate", description = "Show all certificates (persited and non persisted) for the user.")
public Set<X509Certificate> showAllX509Certificates(){
	Set<X509Certificate> all = new HashSet<>(user.getX509Certificates());
	all.addAll(_build().getScimConformUpdateUser().getX509Certificates());
	
	return all;
}
 
开发者ID:osiam,项目名称:shell,代码行数:8,代码来源:UpdateUserBuilder.java


示例17: 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){
	
	List<X509Certificate> certificates = builderCommand.showAllX509Certificates();
	for(X509Certificate current : certificates){
		if(match(current, key, valueExp)){
			builderCommand.builder.removeX509Certificate(current);
		}
	}
}
 
开发者ID:osiam,项目名称:shell,代码行数:15,代码来源:CreateUserDeleteCommands.java


示例18: convertOutput

import org.osiam.resources.scim.X509Certificate; //导入依赖的package包/类
@Override
public Object convertOutput(Object toBeFormatted) {
	if(!(toBeFormatted instanceof X509Certificate)) return null;
	
	final X509Certificate certificate = (X509Certificate)toBeFormatted;
	
	try {
		return toString(certificate);
	} catch (JsonProcessingException e) {
		return e;
	}
}
 
开发者ID:osiam,项目名称:shell,代码行数:13,代码来源:X509CertificateConverter.java


示例19: assertThatX509CertificatesAreEqual

import org.osiam.resources.scim.X509Certificate; //导入依赖的package包/类
private void assertThatX509CertificatesAreEqual(List<X509Certificate> expected, List<X509Certificate> actual) {
    assertEquals(expected.size(), actual.size());
    ensureListSizeIsOne(expected);
    X509Certificate expectedValue = expected.get(0);
    X509Certificate actualValue = actual.get(0);

    assertEquals(expectedValue.getValue(), actualValue.getValue());
    assertEquals(expectedValue.isPrimary(), actualValue.isPrimary());
    assertEquals(expectedValue.getDisplay(), actualValue.getDisplay());
}
 
开发者ID:osiam,项目名称:connector4java-integration-tests,代码行数:11,代码来源:CompleteUserIT.java


示例20: getType

import org.osiam.resources.scim.X509Certificate; //导入依赖的package包/类
public X509Certificate.Type getType() {
    return type;
}
 
开发者ID:osiam,项目名称:osiam,代码行数:4,代码来源:X509CertificateEntity.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TileLayer类代码示例发布时间:2022-05-22
下一篇:
Java UploadFile类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap