All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.nichetoolkit.rest.configure.RestRsaProperties Maven / Gradle / Ivy

The newest version!
package io.github.nichetoolkit.rest.configure;

import io.github.nichetoolkit.rest.util.GeneralUtils;
import io.github.nichetoolkit.rest.worker.rsa.RsaKey;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * RestRsaProperties
 * 

The rest rsa properties class.

* @author Cyan ([email protected]) * @see lombok.Getter * @see lombok.Setter * @see org.springframework.stereotype.Component * @see org.springframework.boot.context.properties.ConfigurationProperties * @since Jdk1.8 */ @Getter @Setter @Component @ConfigurationProperties(prefix = "nichetoolkit.rest.rsa") public class RestRsaProperties { /** * enabled *

The enabled field.

*/ private boolean enabled; /** * keySize * {@link java.lang.Integer}

The keySize field.

* @see java.lang.Integer */ private Integer keySize = 1024; /** * publicKey * {@link java.lang.String}

The publicKey field.

* @see java.lang.String */ private String publicKey; /** * privateKey * {@link java.lang.String}

The privateKey field.

* @see java.lang.String */ private String privateKey; /** * autoVerify *

The autoVerify field.

*/ private boolean autoVerify = true; /** * RestRsaProperties *

Instantiates a new rest rsa properties.

*/ public RestRsaProperties() { } /** * toRsaKey *

The to rsa key method.

* @return {@link io.github.nichetoolkit.rest.worker.rsa.RsaKey}

The to rsa key return object is RsaKey type.

* @see io.github.nichetoolkit.rest.worker.rsa.RsaKey */ public RsaKey toRsaKey() { RsaKey rsaKey = new RsaKey(); if (GeneralUtils.isEmpty(this.publicKey) && GeneralUtils.isEmpty(this.privateKey)) { rsaKey = null; } else { rsaKey.setPublicKey(this.publicKey); rsaKey.setPrivateKey(this.privateKey); rsaKey.setKeySize(this.keySize); } return rsaKey; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy