나는 "클래스"프로필을 확장하는 "사용자 프로필"과 "FingerprintProfile"클래스를 가지고 있습니다.클래스에서 비밀번호를 저장하는 가장 바람직한 방법 - Java
프로필 :
내 다음 수업이 클래스는 사기 것,이 같은 암호를 (심지어 경우 검색 할 수 있도록 완전히 잘못된 것 같다에서 그냥보고 USERPROFILEpublic class UserProfile extends Profile {
/**
* Users password
*/
private char[] password;
/**
* Set User password
* @param password
*/
public void setPassword(char[] password){
this.password = password;
}
/**
* Get User password
*/
public char[] getPassword(){
return password;
}
}
입니다
/**
* Template for User profiles or Fingerprint profiles
*/
public abstract class Profile {
/**
* Profile Name
*/
private String name;
/**
* Profile id
*/
private int id;
/**
* Set the name of this profile
* @param name
*/
public void setProfileName(String name) {
this.name = name;
}
/**
* Set the id of this profile
* @param name
*/
public void setIdNumber(int id) {
this.id = id;
}
/**
* Get the name of this profile
*/
public String getProfileName() {
return name;
}
/**
* Get the id of this profile
*/
public int getIdNumber() {
return id;
}
}
get 메소드는 개인입니다.
내 FingerPrintProfile 클래스를 만들 때 동일한 문제에 직면하게 될뿐만 아니라 본질적으로 보안이 필요한 "FingerprintData"개체를 보유하고있는 것으로 보입니다.
보안 방법이나 사람이이 시나리오와 같은 시나리오를 해결하는 데 사용하는 패턴을 알고있는 사람이 있습니까?
감사합니다.
보너스 상담자 프로필의 두 가지 유형의 템플릿을 제공하는 추상 클래스를 만들어, 지문 데이터와 텍스트 암호 사이에 공통점이있는 것 같다. 그러나 문자 배열이나 FingerprintData 객체가 될 수있는 추상 필드 "password"를 만들 수는 없습니다. 어떤 아이디어?
암호가 암호화되어 있습니까? –
'char [] setPassword()':) – UmNyobe
암호가 암호화되어 있지 않다면, 내가봤을 때의 발전 단계가 무엇인지 알아 보겠습니다. – TomSelleck